Implementing the 'gamemode-testing_windows.patch' per e-mail from Diederick Niehorste...
authorJohn F. Fay <johnffay@nettally.com>
Thu, 17 Mar 2011 02:55:51 +0000 (02:55 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Thu, 17 Mar 2011 02:55:51 +0000 (02:55 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@902 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_gamemode.c

index 7569d1f..2425ac4 100644 (file)
@@ -477,12 +477,15 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
     case DISP_CHANGE_SUCCESSFUL:
         success = GL_TRUE;
 
-        /* update vars in case if windows switched to proper mode */
-        EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, &devMode );
-        fgState.GameModeSize.X  = devMode.dmPelsWidth;        
-        fgState.GameModeSize.Y  = devMode.dmPelsHeight;
-        fgState.GameModeDepth   = devMode.dmBitsPerPel;
-        fgState.GameModeRefresh = devMode.dmDisplayFrequency;
+        if (!haveToTest)
+        {
+            /* update vars in case if windows switched to proper mode */
+            EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, &devMode );
+            fgState.GameModeSize.X  = devMode.dmPelsWidth;        
+            fgState.GameModeSize.Y  = devMode.dmPelsHeight;
+            fgState.GameModeDepth   = devMode.dmBitsPerPel;
+            fgState.GameModeRefresh = devMode.dmDisplayFrequency;
+        }
                break;
     case DISP_CHANGE_RESTART:
         fggmstr = "The computer must be restarted for the graphics mode to work.";