diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-05 15:00:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-05 15:00:58 +0300 |
commit | 9a3a196dbf633a699c26d0227802a42f025c8bfd (patch) | |
tree | dfbdb2ff1e2c54d75a2bf6411d3f70df22518c28 /src/openglgraphics.cpp | |
parent | fc17ff22d9df50df9c5d1cf3dc0de358001271ed (diff) | |
parent | ece36a40d4e9a838cde01075d7681b8fc517b19f (diff) | |
download | plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.gz plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.bz2 plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.xz plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.zip |
Merge branch 'master' into stripped
Conflicts:
src/guichan/gui.cpp
src/guichan/include/guichan/sdl/sdlpixel.hpp
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r-- | src/openglgraphics.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index b744a3caf..2c3d914b0 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -71,7 +71,8 @@ void OpenGLGraphics::setSync(bool sync) mSync = sync; } -bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) +bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, + bool hwaccel, bool resize, bool noFrame) { logger->log("Setting video mode %dx%d %s", w, h, fs ? "fullscreen" : "windowed"); @@ -83,9 +84,25 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) mBpp = bpp; mFullscreen = fs; mHWAccel = hwaccel; + mEnableResize = resize; + mNoFrame = noFrame; if (fs) + { displayFlags |= SDL_FULLSCREEN; + } + else + { + // Resizing currently not supported on Windows, where it would require + // reuploading all textures. +#if !defined(_WIN32) + if (resize) + displayFlags |= SDL_RESIZABLE; +#endif + } + + if (noFrame) + displayFlags |= SDL_NOFRAME; SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); @@ -1017,6 +1034,7 @@ void OpenGLGraphics::_beginDraw() void OpenGLGraphics::_endDraw() { + popClipArea(); } SDL_Surface* OpenGLGraphics::getScreenshot() |