summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-22 14:47:53 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:15 +0300
commit5e4fcb8a6036746ec1b500297fa55989a80094b4 (patch)
tree915d788dcaf3bc39bed6985236fb879c3c93f6cb /src/graphics.cpp
parent2480ea4cc668ff99007dd6fb8b44911eea5d5287 (diff)
downloadmv-5e4fcb8a6036746ec1b500297fa55989a80094b4.tar.gz
mv-5e4fcb8a6036746ec1b500297fa55989a80094b4.tar.bz2
mv-5e4fcb8a6036746ec1b500297fa55989a80094b4.tar.xz
mv-5e4fcb8a6036746ec1b500297fa55989a80094b4.zip
final SDL2 compilation fixes.
now it can be compiled, but still not works.
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)