1 #ifndef _SDLWRAP_DISPLAY_H_
2 #define _SDLWRAP_DISPLAY_H_
6 #include "SDLWrap_Surface.hpp"
7 #include "ErrorHandler.hpp"
11 /* This class is a speacil purpose surface, it represents the actual video frame buffer memory, so it must be created
15 class Display
: public Surface
{
17 /* All flags that can be sent to SetVideoMode, or in this case, the Display constructor, are gathered and
18 * displayed here. To be fair, they can be used in plain Surfaces but that's limited to a few, the first
19 * three of them, or was it four? Anyways, it requires CreateRGBSurface() which I'm unlikely to use, so
23 SWSURFACE
= SDL_SWSURFACE
,
24 HWSURFACE
= SDL_HWSURFACE
,
25 ASYNCBLIT
= SDL_ASYNCBLIT
,
26 ANYFORMAT
= SDL_ANYFORMAT
,
27 HWPALETTE
= SDL_HWPALETTE
,
28 DOUBLEBUF
= SDL_DOUBLEBUF
,
29 FULLSCREEN
= SDL_FULLSCREEN
,
31 OPENGLBLIT
= SDL_OPENGLBLIT
,
32 RESIZABLE
= SDL_RESIZABLE
,
36 /* Really self explanatory constructor, c'mon ^^'
37 * All that's worth noting is that it throws a SurfaceCreationError if it can't create the Display surface.
39 Display(int Width
, int Height
, int BPP
, Uint32 Flags
);
41 /* Just frees the surface as usual. */
42 // ~Display(); // Might not need it as the Surface class has the exact same one...
44 /* If the hardware supports double buffering or if the Display was constructed with the HWSURFACE flag then
45 * this function sets up a flip and returns. The hardware will wait for vertical retrace, and swaps video
46 * buffers before the next video surface blit or lock will return. If SWSURFACE is set on the Display, then it
47 * simply calls SDL_UpdateRect(this->me, 0, 0, 0, 0).
49 * A software screen surface is also updated automatically when parts of a SDL window are redrawn, caused by
50 * overlapping windows or by restoring from an iconified state. As a result there is no proper double buffer
51 * behavior in windowed mode for a software screen, in contrast to a full screen software mode.
53 * You must pass the DOUBLEBUF flag to the Display constructor for the function to perform hardware flipping.