Debian Codegraph @

src/IOGfxDisplay.h

raw
1 #ifndef IOGFXDISPLAY_H
2 #define IOGFXDISPLAY_H
3
4 #include "SDL.h"
5
6 #include "IOGfxSurface.h"
7
8 class IOGfxDisplay {
9 public:
10 int w, h;
11 bool truecolor;
12 Uint32 flags;
13 bool initializedVideo;
14 SDL_Window* window;
15 /* True color fade in [0,256]; 0 is completely dark, 256 is unaltered */
16 double brightness; // TODO: move to int or unsigned short
17
18 public:
19 IOGfxDisplay(int w, int h, bool truecolor, Uint32 flags);
20 virtual ~IOGfxDisplay();
21
22 virtual bool open();
23 virtual void close();
24 virtual void logDisplayInfo();
25
26 virtual Uint32 getFormat();
27
28 virtual void clear() = 0;
29 /* Refresh the physical screen, applying brightness and palette */
30 virtual void flip(IOGfxSurface* backbuffer, SDL_Rect* dstrect,
31 bool interpolation, bool hwflip) = 0;
32 virtual void onSizeChange(int w, int h) = 0;
33 virtual IOGfxSurface* upload(SDL_Surface* s) = 0;
34 virtual IOGfxSurface* allocBuffer(int surfW, int surfH) = 0;
35
36 virtual void flipStretch(IOGfxSurface* backbuffer);
37 virtual void flipDebug(IOGfxSurface* backbuffer);
38
39 virtual void surfToDisplayCoords(IOGfxSurface* backbuffer, int &x, int &y);
40 virtual void centerScaledSurface(IOGfxSurface* surf, SDL_Rect* dst);
41
42 virtual SDL_Surface* screenshot(SDL_Rect* rect) = 0;
43 virtual SDL_Surface* screenshot();
44 void screenshot(const char* output_file);
45
46 bool createWindow();
47 void logWindowInfo();
48 void toggleFullScreen();
49 void toggleScreenKeyboard();
50 };
51
52 extern void flip_it(void);
53
54 #endif