diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-23 21:33:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:16 +0300 |
commit | 1a59946dd91a9de55f114413a520bf36204222ff (patch) | |
tree | 561887087ff3b3a3fbeb21ddc24c75fcd95b984e | |
parent | 86a8a11c5fd21cdff2336b32a2cc30a8ff1d3f57 (diff) | |
download | mv-1a59946dd91a9de55f114413a520bf36204222ff.tar.gz mv-1a59946dd91a9de55f114413a520bf36204222ff.tar.bz2 mv-1a59946dd91a9de55f114413a520bf36204222ff.tar.xz mv-1a59946dd91a9de55f114413a520bf36204222ff.zip |
fix resize in opengl modes in SDL2.
-rw-r--r-- | src/graphics.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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 |