aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl/surfacesdl-graphics.h
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.h')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 49bd66b3e5..2431ce8664 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -77,7 +77,7 @@ public:
*/
class SurfaceSdlGraphicsManager : public SdlGraphicsManager, public Common::EventObserver {
public:
- SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource);
+ SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window);
virtual ~SurfaceSdlGraphicsManager();
virtual void activateManager();
@@ -166,6 +166,17 @@ protected:
/** Hardware screen */
SDL_Surface *_hwscreen;
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ /* SDL2 features a different API for 2D graphics. We create a wrapper
+ * around this API to keep the code paths as close as possible. */
+ SDL_Renderer *_renderer;
+ SDL_Texture *_screenTexture;
+ void deinitializeRenderer();
+
+ SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
+ void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);
+#endif
+
/** Unseen game screen */
SDL_Surface *_screen;
#ifdef USE_RGB_COLOR
@@ -225,6 +236,9 @@ protected:
};
VideoState _videoMode, _oldVideoMode;
+ // Original BPP to restore the video mode on unload
+ uint8 _originalBitsPerPixel;
+
/** Force full redraw on next updateScreen */
bool _forceFull;