From 8292b80eac900ec5dd75d184063b7b35934e800a Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sat, 21 Jan 2012 12:30:36 +0100 Subject: Allow resizing of the game in windowed mode Window positions are semi-smartly corrected as a result of the resize. Not supported when using OpenGL on Windows for now. Reviewed-by: Yohann Ferreira Conflicts: src/client.cpp src/client.h src/game.cpp src/gui/gui.cpp src/gui/widgets/window.cpp --- src/openglgraphics.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/openglgraphics.cpp') diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index b744a3caf..9fb91b201 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -85,7 +85,17 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) mHWAccel = hwaccel; if (fs) + { displayFlags |= SDL_FULLSCREEN; + } + else + { + // Resizing currently not supported on Windows, where it would require + // reuploading all textures. +#if !defined(_WIN32) + displayFlags |= SDL_RESIZABLE; +#endif + } SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); @@ -1017,6 +1027,7 @@ void OpenGLGraphics::_beginDraw() void OpenGLGraphics::_endDraw() { + popClipArea(); } SDL_Surface* OpenGLGraphics::getScreenshot() -- cgit v1.2.3-60-g2f50