From 1a59946dd91a9de55f114413a520bf36204222ff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Aug 2013 21:33:05 +0300 Subject: fix resize in opengl modes in SDL2. --- src/graphics.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/graphics.cpp b/src/graphics.cpp index e0666a36a..0fd8fced9 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -361,6 +361,25 @@ bool Graphics::resizeScreen(const int width, const int height) _endDraw(); +#ifdef USE_SDL2 + mRect.w = width; + mRect.h = height; + mWidth = width; + mHeight = height; + +#ifdef USE_OPENGL + // +++ probably this way will not work in windows/mac + // Setup OpenGL + glViewport(0, 0, mWidth, mHeight); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); +#else + // +++ need impliment resize in soft mode +#endif + + _beginDraw(); + return true; + +#else const bool success = setVideoMode(width, height, mBpp, mFullscreen, mHWAccel, mEnableResize, mNoFrame); @@ -378,6 +397,7 @@ bool Graphics::resizeScreen(const int width, const int height) _beginDraw(); return success; +#endif } int Graphics::getWidth() const -- cgit v1.2.3-70-g09d2