From 5e4fcb8a6036746ec1b500297fa55989a80094b4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 22 Aug 2013 14:47:53 +0300 Subject: final SDL2 compilation fixes. now it can be compiled, but still not works. --- src/graphics.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/graphics.cpp') 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(mWindow->w); mRect.h = static_cast(mWindow->h); +#endif #ifdef __APPLE__ if (mSync) -- cgit v1.2.3-70-g09d2