X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2FCommon%2Ffreeglut_gamemode.c;h=f69595c3b37aaaa80502b9068eca215c7d9701c5;hb=ee696b7ee5011ba23716abe9ffaeb73c6cfac351;hp=9f805ab542077099668901ead539b7b466071ea7;hpb=d2f7ea29ea6d946f455f4363c3f058ff2bdfba35;p=freeglut diff --git a/src/Common/freeglut_gamemode.c b/src/Common/freeglut_gamemode.c index 9f805ab..f69595c 100644 --- a/src/Common/freeglut_gamemode.c +++ b/src/Common/freeglut_gamemode.c @@ -39,6 +39,10 @@ /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ +extern void fgPlatformRememberState( void ); +extern void fgPlatformRestoreState( void ); +extern GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest ); + #if TARGET_HOST_POSIX_X11 static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) @@ -49,11 +53,11 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) Status result = -1; /* must check at runtime for the availability of the extension */ - if(!XRRQueryExtension(fgDisplay.Display, &event_base, &error_base)) { + if(!XRRQueryExtension(fgDisplay.pDisplay.Display, &event_base, &error_base)) { return -1; } - XRRQueryVersion(fgDisplay.Display, &ver_major, &ver_minor); + XRRQueryVersion(fgDisplay.pDisplay.Display, &ver_major, &ver_minor); /* we only heed the rate if we CAN actually use it (Xrandr >= 1.1) and * the user actually cares about it (rate > 0) @@ -76,7 +80,7 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) XRRFreeScreenConfigInfo(xrr_config); } - if(!(xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) { + if(!(xrr_config = XRRGetScreenInfo(fgDisplay.pDisplay.Display, fgDisplay.pDisplay.RootWindow))) { fgWarning("XRRGetScreenInfo failed"); break; } @@ -132,12 +136,12 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) #if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) if(use_rate) - result = XRRSetScreenConfigAndRate(fgDisplay.Display, xrr_config, - fgDisplay.RootWindow, res_idx, rot, rate, timestamp); + result = XRRSetScreenConfigAndRate(fgDisplay.pDisplay.Display, xrr_config, + fgDisplay.pDisplay.RootWindow, res_idx, rot, rate, timestamp); else #endif - result = XRRSetScreenConfig(fgDisplay.Display, xrr_config, - fgDisplay.RootWindow, res_idx, rot, timestamp); + result = XRRSetScreenConfig(fgDisplay.pDisplay.Display, xrr_config, + fgDisplay.pDisplay.RootWindow, res_idx, rot, timestamp); } while(result == RRSetConfigInvalidTime); @@ -154,13 +158,13 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking) } #endif /* TARGET_HOST_POSIX_X11 */ +#if TARGET_HOST_POSIX_X11 /* * Remembers the current visual settings, so that * we can change them and restore later... */ -static void fghRememberState( void ) +void fgPlatformRememberState( void ) { -#if TARGET_HOST_POSIX_X11 int event_base, error_base; /* @@ -170,33 +174,33 @@ static void fghRememberState( void ) Window junk_window; unsigned int junk_mask; - XQueryPointer(fgDisplay.Display, fgDisplay.RootWindow, + XQueryPointer(fgDisplay.pDisplay.Display, fgDisplay.pDisplay.RootWindow, &junk_window, &junk_window, - &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, - &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &junk_mask); + &fgDisplay.pDisplay.DisplayPointerX, &fgDisplay.pDisplay.DisplayPointerY, + &fgDisplay.pDisplay.DisplayPointerX, &fgDisplay.pDisplay.DisplayPointerY, &junk_mask); # ifdef HAVE_X11_EXTENSIONS_XRANDR_H - if(XRRQueryExtension(fgDisplay.Display, &event_base, &error_base)) { + if(XRRQueryExtension(fgDisplay.pDisplay.Display, &event_base, &error_base)) { XRRScreenConfiguration *xrr_config; XRRScreenSize *ssizes; Rotation rot; int ssize_count, curr; - if((xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) { + if((xrr_config = XRRGetScreenInfo(fgDisplay.pDisplay.Display, fgDisplay.pDisplay.RootWindow))) { ssizes = XRRConfigSizes(xrr_config, &ssize_count); curr = XRRConfigCurrentConfiguration(xrr_config, &rot); - fgDisplay.prev_xsz = ssizes[curr].width; - fgDisplay.prev_ysz = ssizes[curr].height; - fgDisplay.prev_refresh = -1; + fgDisplay.pDisplay.prev_xsz = ssizes[curr].width; + fgDisplay.pDisplay.prev_ysz = ssizes[curr].height; + fgDisplay.pDisplay.prev_refresh = -1; # if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) ) if(fgState.GameModeRefresh != -1) { - fgDisplay.prev_refresh = XRRConfigCurrentRate(xrr_config); + fgDisplay.pDisplay.prev_refresh = XRRConfigCurrentRate(xrr_config); } # endif - fgDisplay.prev_size_valid = 1; + fgDisplay.pDisplay.prev_size_valid = 1; XRRFreeScreenConfigInfo(xrr_config); } @@ -208,7 +212,7 @@ static void fghRememberState( void ) * not approved as X Consortium standards */ # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H - if(!XF86VidModeQueryExtension(fgDisplay.Display, &event_base, &error_base)) { + if(!XF86VidModeQueryExtension(fgDisplay.pDisplay.Display, &event_base, &error_base)) { return; } @@ -217,64 +221,48 @@ static void fghRememberState( void ) * restore the ViewPort on LeaveGameMode(): */ if( !XF86VidModeGetViewPort( - fgDisplay.Display, - fgDisplay.Screen, - &fgDisplay.DisplayViewPortX, - &fgDisplay.DisplayViewPortY ) ) + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, + &fgDisplay.pDisplay.DisplayViewPortX, + &fgDisplay.pDisplay.DisplayViewPortY ) ) fgWarning( "XF86VidModeGetViewPort failed" ); /* Query the current display settings: */ - fgDisplay.DisplayModeValid = + fgDisplay.pDisplay.DisplayModeValid = XF86VidModeGetModeLine( - fgDisplay.Display, - fgDisplay.Screen, - &fgDisplay.DisplayModeClock, - &fgDisplay.DisplayMode + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, + &fgDisplay.pDisplay.DisplayModeClock, + &fgDisplay.pDisplay.DisplayMode ); - if( !fgDisplay.DisplayModeValid ) + if( !fgDisplay.pDisplay.DisplayModeValid ) fgWarning( "XF86VidModeGetModeLine failed" ); # endif -#elif TARGET_HOST_MS_WINDOWS - -/* DEVMODE devMode; */ - - /* Grab the current desktop settings... */ - -/* hack to get around my stupid cross-gcc headers */ -#define FREEGLUT_ENUM_CURRENT_SETTINGS -1 - - EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, - &fgDisplay.DisplayMode ); - - /* Make sure we will be restoring all settings needed */ - fgDisplay.DisplayMode.dmFields |= - DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY; - -#endif } +#endif +#if TARGET_HOST_POSIX_X11 /* * Restores the previously remembered visual settings */ -static void fghRestoreState( void ) +void fgPlatformRestoreState( void ) { -#if TARGET_HOST_POSIX_X11 /* Restore the remembered pointer position: */ XWarpPointer( - fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0, - fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY + fgDisplay.pDisplay.Display, None, fgDisplay.pDisplay.RootWindow, 0, 0, 0, 0, + fgDisplay.pDisplay.DisplayPointerX, fgDisplay.pDisplay.DisplayPointerY ); # ifdef HAVE_X11_EXTENSIONS_XRANDR_H - if(fgDisplay.prev_size_valid) { - if(xrandr_resize(fgDisplay.prev_xsz, fgDisplay.prev_ysz, fgDisplay.prev_refresh, 0) != -1) { - fgDisplay.prev_size_valid = 0; + if(fgDisplay.pDisplay.prev_size_valid) { + if(xrandr_resize(fgDisplay.pDisplay.prev_xsz, fgDisplay.pDisplay.prev_ysz, fgDisplay.pDisplay.prev_refresh, 0) != -1) { + fgDisplay.pDisplay.prev_size_valid = 0; # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H - fgDisplay.DisplayModeValid = 0; + fgDisplay.pDisplay.DisplayModeValid = 0; # endif return; } @@ -289,14 +277,14 @@ static void fghRestoreState( void ) * not approved as X Consortium standards */ - if( fgDisplay.DisplayModeValid ) + if( fgDisplay.pDisplay.DisplayModeValid ) { XF86VidModeModeInfo** displayModes; int i, displayModesCount; if( !XF86VidModeGetAllModeLines( - fgDisplay.Display, - fgDisplay.Screen, + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, &displayModesCount, &displayModes ) ) { @@ -311,13 +299,13 @@ static void fghRestoreState( void ) */ for( i = 0; i < displayModesCount; i++ ) { - if(displayModes[ i ]->hdisplay == fgDisplay.DisplayMode.hdisplay && - displayModes[ i ]->vdisplay == fgDisplay.DisplayMode.vdisplay && - displayModes[ i ]->dotclock == fgDisplay.DisplayModeClock ) + if(displayModes[ i ]->hdisplay == fgDisplay.pDisplay.DisplayMode.hdisplay && + displayModes[ i ]->vdisplay == fgDisplay.pDisplay.DisplayMode.vdisplay && + displayModes[ i ]->dotclock == fgDisplay.pDisplay.DisplayModeClock ) { if( !XF86VidModeSwitchToMode( - fgDisplay.Display, - fgDisplay.Screen, + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, displayModes[ i ] ) ) { fgWarning( "XF86VidModeSwitchToMode failed" ); @@ -325,10 +313,10 @@ static void fghRestoreState( void ) } if( !XF86VidModeSetViewPort( - fgDisplay.Display, - fgDisplay.Screen, - fgDisplay.DisplayViewPortX, - fgDisplay.DisplayViewPortY ) ) + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, + fgDisplay.pDisplay.DisplayViewPortX, + fgDisplay.pDisplay.DisplayViewPortY ) ) fgWarning( "XF86VidModeSetViewPort failed" ); @@ -337,11 +325,11 @@ static void fghRestoreState( void ) * calls exit() we've to flush the X11 output queue to have the * commands sent to the X server before the application exits. */ - XFlush( fgDisplay.Display ); + XFlush( fgDisplay.pDisplay.Display ); - fgDisplay.DisplayModeValid = 0; + fgDisplay.pDisplay.DisplayModeValid = 0; # ifdef HAVE_X11_EXTENSIONS_XRANDR_H - fgDisplay.prev_size_valid = 0; + fgDisplay.pDisplay.prev_size_valid = 0; # endif break; @@ -352,13 +340,8 @@ static void fghRestoreState( void ) # endif -#elif TARGET_HOST_MS_WINDOWS - - /* Restore the previously remembered desktop display settings */ - ChangeDisplaySettingsEx( fgDisplay.DisplayName,&fgDisplay.DisplayMode, 0,0,0 ); - -#endif } +#endif #if TARGET_HOST_POSIX_X11 #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H @@ -410,14 +393,14 @@ static int fghCheckDisplayModes( GLboolean exactMatch, int displayModesCount, XF #endif #endif +#if TARGET_HOST_POSIX_X11 + /* * Changes the current display mode to match user's settings */ -static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) +GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest ) { GLboolean success = GL_FALSE; -#if TARGET_HOST_POSIX_X11 - /* first try to use XRandR, then fallback to XF86VidMode */ # ifdef HAVE_X11_EXTENSIONS_XRANDR_H if(xrandr_resize(fgState.GameModeSize.X, fgState.GameModeSize.Y, @@ -437,7 +420,7 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) * This is also used by applications which check modes by calling * glutGameModeGet(GLUT_GAME_MODE_POSSIBLE), so allow the check: */ - if( haveToTest || fgDisplay.DisplayModeValid ) + if( haveToTest || fgDisplay.pDisplay.DisplayModeValid ) { XF86VidModeModeInfo** displayModes; int i, displayModesCount; @@ -447,20 +430,20 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) * glutEnterGameMode, then we need to query the current mode, to make * unspecified settings to default to their current values. */ - if(!fgDisplay.DisplayModeValid) { - if(!XF86VidModeGetModeLine(fgDisplay.Display, fgDisplay.Screen, - &fgDisplay.DisplayModeClock, &fgDisplay.DisplayMode)) { + if(!fgDisplay.pDisplay.DisplayModeValid) { + if(!XF86VidModeGetModeLine(fgDisplay.pDisplay.Display, fgDisplay.pDisplay.Screen, + &fgDisplay.pDisplay.DisplayModeClock, &fgDisplay.pDisplay.DisplayMode)) { return success; } } if (fgState.GameModeSize.X == -1) { - fgState.GameModeSize.X = fgDisplay.DisplayMode.hdisplay; + fgState.GameModeSize.X = fgDisplay.pDisplay.DisplayMode.hdisplay; } if (fgState.GameModeSize.Y == -1) { - fgState.GameModeSize.Y = fgDisplay.DisplayMode.vdisplay; + fgState.GameModeSize.Y = fgDisplay.pDisplay.DisplayMode.vdisplay; } if (fgState.GameModeDepth == -1) { @@ -471,16 +454,16 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) if (fgState.GameModeRefresh == -1) { /* Compute the displays refresh rate, dotclock comes in kHz. */ - int refresh = ( fgDisplay.DisplayModeClock * 1000 ) / - ( fgDisplay.DisplayMode.htotal * fgDisplay.DisplayMode.vtotal ); + int refresh = ( fgDisplay.pDisplay.DisplayModeClock * 1000 ) / + ( fgDisplay.pDisplay.DisplayMode.htotal * fgDisplay.pDisplay.DisplayMode.vtotal ); fgState.GameModeRefresh = refresh; } /* query all possible display modes */ if( !XF86VidModeGetAllModeLines( - fgDisplay.Display, - fgDisplay.Screen, + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, &displayModesCount, &displayModes ) ) { @@ -501,8 +484,8 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) if( !haveToTest && success ) { if( !XF86VidModeSwitchToMode( - fgDisplay.Display, - fgDisplay.Screen, + fgDisplay.pDisplay.Display, + fgDisplay.pDisplay.Screen, displayModes[ i ] ) ) fgWarning( "XF86VidModeSwitchToMode failed" ); } @@ -512,88 +495,10 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) # endif - -#elif TARGET_HOST_MS_WINDOWS - - DEVMODE devMode; - char *fggmstr = NULL; - char displayMode[300]; - - success = GL_FALSE; - - EnumDisplaySettings( fgDisplay.DisplayName, -1, &devMode ); - devMode.dmFields = 0; - - if (fgState.GameModeSize.X!=-1) - { - devMode.dmPelsWidth = fgState.GameModeSize.X; - devMode.dmFields |= DM_PELSWIDTH; - } - if (fgState.GameModeSize.Y!=-1) - { - devMode.dmPelsHeight = fgState.GameModeSize.Y; - devMode.dmFields |= DM_PELSHEIGHT; - } - if (fgState.GameModeDepth!=-1) - { - devMode.dmBitsPerPel = fgState.GameModeDepth; - devMode.dmFields |= DM_BITSPERPEL; - } - if (fgState.GameModeRefresh!=-1) - { - devMode.dmDisplayFrequency = fgState.GameModeRefresh; - devMode.dmFields |= DM_DISPLAYFREQUENCY; - } - - switch ( ChangeDisplaySettingsEx(fgDisplay.DisplayName, &devMode, NULL, haveToTest ? CDS_TEST : CDS_FULLSCREEN , NULL) ) - { - case DISP_CHANGE_SUCCESSFUL: - success = GL_TRUE; - - 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."; - break; - case DISP_CHANGE_BADFLAGS: - fggmstr = "An invalid set of flags was passed in."; - break; - case DISP_CHANGE_BADPARAM: - fggmstr = "An invalid parameter was passed in. This can include an invalid flag or combination of flags."; - break; - case DISP_CHANGE_FAILED: - fggmstr = "The display driver failed the specified graphics mode."; - break; - case DISP_CHANGE_BADMODE: - fggmstr = "The graphics mode is not supported."; - break; - default: - fggmstr = "Unknown error in graphics mode???"; /* dunno if it is possible,MSDN does not mention any other error */ - break; - } - - if ( !success ) - { - /* I'd rather get info whats going on in my program than wonder about */ - /* magic happenings behind my back, its lib for devels at last ;) */ - - /* append display mode to error to make things more informative */ - sprintf(displayMode,"%s Problem with requested mode: %ix%i:%i@%i", fggmstr, devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel, devMode.dmDisplayFrequency); - fgWarning(displayMode); - } -#endif - return success; } +#endif /* -- INTERFACE FUNCTIONS -------------------------------------------------- */ @@ -627,7 +532,7 @@ void FGAPIENTRY glutGameModeString( const char* string ) /* All values not specified are now set to -1, which means those * aspects of the current display mode are not changed in - * fghChangeDisplayMode() above. + * fgPlatformChangeDisplayMode() above. */ fgState.GameModeSize.X = width; fgState.GameModeSize.Y = height; @@ -647,9 +552,9 @@ int FGAPIENTRY glutEnterGameMode( void ) if( fgStructure.GameModeWindow ) fgAddToWindowDestroyList( fgStructure.GameModeWindow ); else - fghRememberState( ); + fgPlatformRememberState( ); - if( ! fghChangeDisplayMode( GL_FALSE ) ) + if( ! fgPlatformChangeDisplayMode( GL_FALSE ) ) { fgWarning( "failed to change screen settings" ); return 0; @@ -671,7 +576,7 @@ int FGAPIENTRY glutEnterGameMode( void ) * Sync needed to avoid a real race, the Xserver must have really created * the window before we can grab the pointer into it: */ - XSync( fgDisplay.Display, False ); + XSync( fgDisplay.pDisplay.Display, False ); /* * Grab the pointer to confine it into the window after the calls to * XWrapPointer() which ensure that the pointer really enters the window. @@ -682,7 +587,7 @@ int FGAPIENTRY glutEnterGameMode( void ) * the application which we have to aviod, so wait until it's viewable: */ while( GrabSuccess != XGrabPointer( - fgDisplay.Display, fgStructure.GameModeWindow->Window.Handle, + fgDisplay.pDisplay.Display, fgStructure.GameModeWindow->Window.Handle, TRUE, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask, @@ -694,7 +599,7 @@ int FGAPIENTRY glutEnterGameMode( void ) * if the new window is not viewable yet, see the XGrabPointer loop above. */ XSetInputFocus( - fgDisplay.Display, + fgDisplay.pDisplay.Display, fgStructure.GameModeWindow->Window.Handle, RevertToNone, CurrentTime @@ -702,22 +607,22 @@ int FGAPIENTRY glutEnterGameMode( void ) /* Move the Pointer to the middle of the fullscreen window */ XWarpPointer( - fgDisplay.Display, + fgDisplay.pDisplay.Display, None, - fgDisplay.RootWindow, + fgDisplay.pDisplay.RootWindow, 0, 0, 0, 0, fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2 ); # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H - if( fgDisplay.DisplayModeValid ) + if( fgDisplay.pDisplay.DisplayModeValid ) { int x, y; Window child; /* Change to viewport to the window topleft edge: */ - if( !XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 ) ) + if( !XF86VidModeSetViewPort( fgDisplay.pDisplay.Display, fgDisplay.pDisplay.Screen, 0, 0 ) ) fgWarning( "XF86VidModeSetViewPort failed" ); /* @@ -728,15 +633,15 @@ int FGAPIENTRY glutEnterGameMode( void ) /* Get the current postion of the drawable area on screen */ XTranslateCoordinates( - fgDisplay.Display, + fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle, - fgDisplay.RootWindow, + fgDisplay.pDisplay.RootWindow, 0, 0, &x, &y, &child ); /* Move the decorataions out of the topleft corner of the display */ - XMoveWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle, + XMoveWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle, -x, -y); } @@ -744,7 +649,7 @@ int FGAPIENTRY glutEnterGameMode( void ) /* Grab the keyboard, too */ XGrabKeyboard( - fgDisplay.Display, + fgDisplay.pDisplay.Display, fgStructure.GameModeWindow->Window.Handle, FALSE, GrabModeAsync, GrabModeAsync, @@ -770,12 +675,12 @@ void FGAPIENTRY glutLeaveGameMode( void ) #if TARGET_HOST_POSIX_X11 - XUngrabPointer( fgDisplay.Display, CurrentTime ); - XUngrabKeyboard( fgDisplay.Display, CurrentTime ); + XUngrabPointer( fgDisplay.pDisplay.Display, CurrentTime ); + XUngrabKeyboard( fgDisplay.pDisplay.Display, CurrentTime ); #endif - fghRestoreState(); + fgPlatformRestoreState(); } /* @@ -791,7 +696,7 @@ int FGAPIENTRY glutGameModeGet( GLenum eWhat ) return !!fgStructure.GameModeWindow; case GLUT_GAME_MODE_POSSIBLE: - return fghChangeDisplayMode( GL_TRUE ); + return fgPlatformChangeDisplayMode( GL_TRUE ); case GLUT_GAME_MODE_WIDTH: return fgState.GameModeSize.X;