summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index d1d5a9590..e08304b24 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -53,6 +53,9 @@ Graphics::Graphics() :
mWidth(0),
mHeight(0),
mWindow(nullptr),
+#ifdef USE_SDL2
+ mRenderer(nullptr),
+#endif
mBpp(0),
mAlpha(false),
mFullscreen(false),
@@ -153,8 +156,18 @@ bool Graphics::setOpenGLMode()
return false;
}
+#ifdef USE_SDL2
+ int w1 = 0;
+ int h1 = 0;
+ SDL_GetWindowSize(mWindow, &w1, &h1);
+ mRect.w = w1;
+ mRect.h = h1;
+
+ mRenderer = graphicsManager.createRenderer(mWindow, 0);
+#else
mRect.w = static_cast<uint16_t>(mWindow->w);
mRect.h = static_cast<uint16_t>(mWindow->h);
+#endif
#ifdef __APPLE__
if (mSync)