From ac7b481fed95ce2f9823bf23f8733018665c51be Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Sat, 10 Mar 2012 03:17:55 +0000 Subject: [PATCH] in freeglut_init set gamemode defaults to -1 (no change from current display mode) so that it is not attempted to change the display mode to some arbitrary default when entering gamemode (only applies if glutGameModeString is never called) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1097 7f0cb862-5218-0410-a997-914c9d46530a --- src/Common/freeglut_init.c | 14 +++++++------- src/mswin/freeglut_gamemode_mswin.c | 8 ++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Common/freeglut_init.c b/src/Common/freeglut_init.c index 20073bb..bb0c097 100644 --- a/src/Common/freeglut_init.c +++ b/src/Common/freeglut_init.c @@ -73,9 +73,9 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ 0, /* ActiveMenus */ NULL, /* MenuStateCallback */ NULL, /* MenuStatusCallback */ - { 640, 480, GL_TRUE }, /* GameModeSize */ - 16, /* GameModeDepth */ - 72, /* GameModeRefresh */ + { -1, -1, GL_TRUE }, /* GameModeSize */ + -1, /* GameModeDepth */ + -1, /* GameModeRefresh */ GLUT_ACTION_EXIT, /* ActionOnWindowClose */ GLUT_EXEC_STATE_INIT, /* ExecState */ NULL, /* ProgramName */ @@ -286,10 +286,10 @@ void fgDeinitialize( void ) fgState.KeyRepeat = GLUT_KEY_REPEAT_ON; fgState.Modifiers = INVALID_MODIFIERS; - fgState.GameModeSize.X = 640; - fgState.GameModeSize.Y = 480; - fgState.GameModeDepth = 16; - fgState.GameModeRefresh = 72; + fgState.GameModeSize.X = -1; + fgState.GameModeSize.Y = -1; + fgState.GameModeDepth = -1; + fgState.GameModeRefresh = -1; fgListInit( &fgState.Timers ); fgListInit( &fgState.FreeTimers ); diff --git a/src/mswin/freeglut_gamemode_mswin.c b/src/mswin/freeglut_gamemode_mswin.c index b1a75d4..e0a7c22 100644 --- a/src/mswin/freeglut_gamemode_mswin.c +++ b/src/mswin/freeglut_gamemode_mswin.c @@ -34,12 +34,10 @@ */ void fgPlatformRememberState( void ) { -/* DEVMODE devMode; */ - /* Grab the current desktop settings... */ -/* hack to get around my stupid cross-gcc headers */ -#define FREEGLUT_ENUM_CURRENT_SETTINGS -1 + /* hack to get around my stupid cross-gcc headers */ + #define FREEGLUT_ENUM_CURRENT_SETTINGS -1 EnumDisplaySettings( fgDisplay.pDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, &fgDisplay.pDisplay.DisplayMode ); @@ -57,7 +55,6 @@ void fgPlatformRestoreState( void ) { /* Restore the previously remembered desktop display settings */ ChangeDisplaySettingsEx( fgDisplay.pDisplay.DisplayName,&fgDisplay.pDisplay.DisplayMode, 0,0,0 ); - } @@ -154,4 +151,3 @@ void fgPlatformEnterGameMode( void ) void fgPlatformLeaveGameMode( void ) { } - -- 1.7.10.4