]> git.tdb.fi Git - libs/gui.git/commitdiff
Change video mode before reconfiguring the window
authorMikko Rasa <tdb@tdb.fi>
Sun, 12 Jan 2014 11:43:20 +0000 (13:43 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 12 Jan 2014 11:43:20 +0000 (13:43 +0200)
This prevents the window options from getting out of sync if the video
mode can't be set.

source/graphics/window.cpp

index 256ab2d470ace62169af6c938f42722482f76412..00acbc459446a6d410d12d876f4bb7662f4265f0 100644 (file)
@@ -62,16 +62,16 @@ void Window::reconfigure(const WindowOptions &opts)
        bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
        resizing = (opts.width!=options.width || opts.height!=options.height);
 
-       options = opts;
-       platform_reconfigure(fullscreen_changed);
-
        if(visible)
        {
-               if(options.fullscreen)
-                       display.set_mode(VideoMode(options.width, options.height));
+               if(opts.fullscreen)
+                       display.set_mode(VideoMode(opts.width, opts.height));
                else if(fullscreen_changed)
                        display.restore_mode();
        }
+
+       options = opts;
+       platform_reconfigure(fullscreen_changed);
 }
 
 void Window::set_keyboard_autorepeat(bool r)