| 1 |
#ifndef IOGFXDISPLAYSW_H |
| 2 |
#define IOGFXDISPLAYSW_H |
| 3 |
|
| 4 |
#include "IOGfxDisplay.h" |
| 5 |
|
| 6 |
class IOGfxDisplaySW: public IOGfxDisplay { |
| 7 |
private: |
| 8 |
SDL_Renderer* renderer; |
| 9 |
/* Streaming texture to push software buffer -> hardware */ |
| 10 |
SDL_Texture* render_texture_linear; |
| 11 |
/* Non-interpolated texture for printing raw textures during tests screenshots */ |
| 12 |
SDL_Texture* render_texture_nearest; |
| 13 |
/* Intermediary texture to convert 8bit->24bit in non-truecolor */ |
| 14 |
SDL_Surface *rgb_screen; |
| 15 |
|
| 16 |
public: |
| 17 |
IOGfxDisplaySW(int w, int h, bool truecolor, Uint32 flags); |
| 18 |
virtual ~IOGfxDisplaySW(); |
| 19 |
|
| 20 |
virtual bool open(); |
| 21 |
virtual void close(); |
| 22 |
virtual void logDisplayInfo(); |
| 23 |
|
| 24 |
virtual void clear(); |
| 25 |
virtual void onSizeChange(int w, int h); |
| 26 |
virtual IOGfxSurface* upload(SDL_Surface* s); |
| 27 |
virtual IOGfxSurface* allocBuffer(int surfW, int surfH); |
| 28 |
virtual void flip(IOGfxSurface* backbuffer, SDL_Rect* dstrect, |
| 29 |
bool interpolation, bool hwflip); |
| 30 |
|
| 31 |
virtual SDL_Surface* screenshot(SDL_Rect* rect); |
| 32 |
|
| 33 |
bool createRenderer(); |
| 34 |
void logRenderersInfo(); |
| 35 |
|
| 36 |
bool createRenderTexture(int w, int h); |
| 37 |
void logRenderTextureInfo(); |
| 38 |
}; |
| 39 |
|
| 40 |
#endif |