4 * The game mode handling code.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Thu Dec 16 1999
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #include <GL/freeglut.h>
29 #include "freeglut_internal.h"
32 * TODO BEFORE THE STABLE RELEASE:
34 * glutGameModeString() -- missing
35 * glutEnterGameMode() -- X11 version
36 * glutLeaveGameMode() -- is that correct?
37 * glutGameModeGet() -- is that correct?
41 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
43 #if TARGET_HOST_POSIX_X11
44 static int xrandr_resize(int xsz, int ysz, int rate, int just_checking)
46 #ifdef HAVE_X11_EXTENSIONS_XRANDR_H
47 int event_base, error_base, ver_major, ver_minor, use_rate;
48 XRRScreenConfiguration *xrr_config = 0;
51 /* must check at runtime for the availability of the extension */
52 if(!XRRQueryExtension(fgDisplay.Display, &event_base, &error_base)) {
56 XRRQueryVersion(fgDisplay.Display, &ver_major, &ver_minor);
58 /* we only heed the rate if we CAN actually use it (Xrandr >= 1.1) and
59 * the user actually cares about it (rate > 0)
61 use_rate = ( rate > 0 ) && ( ( ver_major >= 1 ) ||
62 ( ( ver_major == 1 ) && ( ver_minor >= 1 ) ) );
64 /* this loop is only so that the whole thing will be repeated if someone
65 * else changes video mode between our query of the current information and
66 * the attempt to change it.
69 XRRScreenSize *ssizes;
72 int i, ssizes_count, rates_count, curr, res_idx = -1;
73 Time timestamp, cfg_timestamp;
76 XRRFreeScreenConfigInfo(xrr_config);
79 if(!(xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) {
80 fgWarning("XRRGetScreenInfo failed");
83 ssizes = XRRConfigSizes(xrr_config, &ssizes_count);
84 curr = XRRConfigCurrentConfiguration(xrr_config, &rot);
85 timestamp = XRRConfigTimes(xrr_config, &cfg_timestamp);
87 /* if either of xsz or ysz are unspecified, use the current values */
89 xsz = fgState.GameModeSize.X = ssizes[curr].width;
91 ysz = fgState.GameModeSize.Y = ssizes[curr].height;
94 if(xsz == ssizes[curr].width && ysz == ssizes[curr].height) {
95 /* no need to switch, we're already in the requested resolution */
98 for(i=0; i<ssizes_count; i++) {
99 if(ssizes[i].width == xsz && ssizes[i].height == ysz) {
101 break; /* found it */
106 break; /* no matching resolution */
108 #if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) )
110 rate = fgState.GameModeRefresh;
112 /* for the selected resolution, let's find out if there is
113 * a matching refresh rate available.
115 rates = XRRConfigRates(xrr_config, res_idx, &rates_count);
117 for(i=0; i<rates_count; i++) {
118 if(rates[i] == rate) {
122 if(i == rates_count) {
123 break; /* no matching rate */
133 #if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) )
135 result = XRRSetScreenConfigAndRate(fgDisplay.Display, xrr_config,
136 fgDisplay.RootWindow, res_idx, rot, rate, timestamp);
139 result = XRRSetScreenConfig(fgDisplay.Display, xrr_config,
140 fgDisplay.RootWindow, res_idx, rot, timestamp);
142 } while(result == RRSetConfigInvalidTime);
145 XRRFreeScreenConfigInfo(xrr_config);
152 #endif /* HAVE_X11_EXTENSIONS_XRANDR_H */
155 #endif /* TARGET_HOST_POSIX_X11 */
158 * Remembers the current visual settings, so that
159 * we can change them and restore later...
161 static void fghRememberState( void )
163 #if TARGET_HOST_POSIX_X11
164 int event_base, error_base;
167 * Remember the current pointer location before going fullscreen
168 * for restoring it later:
171 unsigned int junk_mask;
173 XQueryPointer(fgDisplay.Display, fgDisplay.RootWindow,
174 &junk_window, &junk_window,
175 &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY,
176 &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &junk_mask);
178 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
179 if(XRRQueryExtension(fgDisplay.Display, &event_base, &error_base)) {
180 XRRScreenConfiguration *xrr_config;
181 XRRScreenSize *ssizes;
183 int ssize_count, curr;
185 if((xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) {
186 ssizes = XRRConfigSizes(xrr_config, &ssize_count);
187 curr = XRRConfigCurrentConfiguration(xrr_config, &rot);
189 fgDisplay.prev_xsz = ssizes[curr].width;
190 fgDisplay.prev_ysz = ssizes[curr].height;
191 fgDisplay.prev_refresh = -1;
193 # if ( RANDR_MAJOR >= 1 ) || ( ( RANDR_MAJOR == 1 ) && ( RANDR_MINOR >= 1 ) )
194 if(fgState.GameModeRefresh != -1) {
195 fgDisplay.prev_refresh = XRRConfigCurrentRate(xrr_config);
199 fgDisplay.prev_size_valid = 1;
201 XRRFreeScreenConfigInfo(xrr_config);
207 * This highly depends on the XFree86 extensions,
208 * not approved as X Consortium standards
210 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
211 if(!XF86VidModeQueryExtension(fgDisplay.Display, &event_base, &error_base)) {
216 * Remember the current ViewPort location of the screen to be able to
217 * restore the ViewPort on LeaveGameMode():
219 if( !XF86VidModeGetViewPort(
222 &fgDisplay.DisplayViewPortX,
223 &fgDisplay.DisplayViewPortY ) )
224 fgWarning( "XF86VidModeGetViewPort failed" );
227 /* Query the current display settings: */
228 fgDisplay.DisplayModeValid =
229 XF86VidModeGetModeLine(
232 &fgDisplay.DisplayModeClock,
233 &fgDisplay.DisplayMode
236 if( !fgDisplay.DisplayModeValid )
237 fgWarning( "XF86VidModeGetModeLine failed" );
240 #elif TARGET_HOST_MS_WINDOWS
242 /* DEVMODE devMode; */
244 /* Grab the current desktop settings... */
246 /* hack to get around my stupid cross-gcc headers */
247 #define FREEGLUT_ENUM_CURRENT_SETTINGS -1
249 EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS,
250 &fgDisplay.DisplayMode );
252 /* Make sure we will be restoring all settings needed */
253 fgDisplay.DisplayMode.dmFields |=
254 DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
260 * Restores the previously remembered visual settings
262 static void fghRestoreState( void )
264 #if TARGET_HOST_POSIX_X11
265 /* Restore the remembered pointer position: */
267 fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
268 fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
272 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
273 if(fgDisplay.prev_size_valid) {
274 if(xrandr_resize(fgDisplay.prev_xsz, fgDisplay.prev_ysz, fgDisplay.prev_refresh, 0) != -1) {
275 fgDisplay.prev_size_valid = 0;
276 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
277 fgDisplay.DisplayModeValid = 0;
286 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
288 * This highly depends on the XFree86 extensions,
289 * not approved as X Consortium standards
292 if( fgDisplay.DisplayModeValid )
294 XF86VidModeModeInfo** displayModes;
295 int i, displayModesCount;
297 if( !XF86VidModeGetAllModeLines(
303 fgWarning( "XF86VidModeGetAllModeLines failed" );
309 * Check every of the modes looking for one that matches our demands.
310 * If we find one, switch to it and restore the remembered viewport.
312 for( i = 0; i < displayModesCount; i++ )
314 if(displayModes[ i ]->hdisplay == fgDisplay.DisplayMode.hdisplay &&
315 displayModes[ i ]->vdisplay == fgDisplay.DisplayMode.vdisplay &&
316 displayModes[ i ]->dotclock == fgDisplay.DisplayModeClock )
318 if( !XF86VidModeSwitchToMode(
321 displayModes[ i ] ) )
323 fgWarning( "XF86VidModeSwitchToMode failed" );
327 if( !XF86VidModeSetViewPort(
330 fgDisplay.DisplayViewPortX,
331 fgDisplay.DisplayViewPortY ) )
332 fgWarning( "XF86VidModeSetViewPort failed" );
336 * For the case this would be the last X11 call the application
337 * calls exit() we've to flush the X11 output queue to have the
338 * commands sent to the X server before the application exits.
340 XFlush( fgDisplay.Display );
342 fgDisplay.DisplayModeValid = 0;
343 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
344 fgDisplay.prev_size_valid = 0;
350 XFree( displayModes );
355 #elif TARGET_HOST_MS_WINDOWS
357 /* Restore the previously remembered desktop display settings */
358 ChangeDisplaySettingsEx( fgDisplay.DisplayName,&fgDisplay.DisplayMode, 0,0,0 );
363 #if TARGET_HOST_POSIX_X11
364 #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
367 * Checks a single display mode settings against user's preferences.
369 static GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
371 /* The desired values should be stored in fgState structure... */
372 return ( width == fgState.GameModeSize.X ) &&
373 ( height == fgState.GameModeSize.Y ) &&
374 ( depth == fgState.GameModeDepth ) &&
375 ( refresh == fgState.GameModeRefresh );
379 * Checks all display modes settings against user's preferences.
380 * Returns the mode number found or -1 if none could be found.
382 static int fghCheckDisplayModes( GLboolean exactMatch, int displayModesCount, XF86VidModeModeInfo** displayModes )
385 for( i = 0; i < displayModesCount; i++ )
387 /* Compute the displays refresh rate, dotclock comes in kHz. */
388 int refresh = ( displayModes[ i ]->dotclock * 1000 ) /
389 ( displayModes[ i ]->htotal * displayModes[ i ]->vtotal );
391 if( fghCheckDisplayMode( displayModes[ i ]->hdisplay,
392 displayModes[ i ]->vdisplay,
393 fgState.GameModeDepth,
394 ( exactMatch ? refresh : fgState.GameModeRefresh ) ) ) {
397 /* Update the chosen refresh rate, otherwise a
398 * glutGameModeGet(GLUT_GAME_MODE_REFRESH_RATE) would not
399 * return the right values
401 fgState.GameModeRefresh = refresh;
414 * Changes the current display mode to match user's settings
416 static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
418 GLboolean success = GL_FALSE;
419 #if TARGET_HOST_POSIX_X11
421 /* first try to use XRandR, then fallback to XF86VidMode */
422 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
423 if(xrandr_resize(fgState.GameModeSize.X, fgState.GameModeSize.Y,
424 fgState.GameModeRefresh, haveToTest) != -1) {
431 * This highly depends on the XFree86 extensions,
432 * not approved as X Consortium standards
434 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
437 * This is also used by applications which check modes by calling
438 * glutGameModeGet(GLUT_GAME_MODE_POSSIBLE), so allow the check:
440 if( haveToTest || fgDisplay.DisplayModeValid )
442 XF86VidModeModeInfo** displayModes;
443 int i, displayModesCount;
445 /* If we don't have a valid modeline in the display structure, which
446 * can happen if this is called from glutGameModeGet instead of
447 * glutEnterGameMode, then we need to query the current mode, to make
448 * unspecified settings to default to their current values.
450 if(!fgDisplay.DisplayModeValid) {
451 if(!XF86VidModeGetModeLine(fgDisplay.Display, fgDisplay.Screen,
452 &fgDisplay.DisplayModeClock, &fgDisplay.DisplayMode)) {
457 if (fgState.GameModeSize.X == -1)
459 fgState.GameModeSize.X = fgDisplay.DisplayMode.hdisplay;
461 if (fgState.GameModeSize.Y == -1)
463 fgState.GameModeSize.Y = fgDisplay.DisplayMode.vdisplay;
465 if (fgState.GameModeDepth == -1)
467 /* can't get color depth from this, nor can we change it, do nothing
468 * TODO: get with XGetVisualInfo()? but then how to set?
471 if (fgState.GameModeRefresh == -1)
473 /* Compute the displays refresh rate, dotclock comes in kHz. */
474 int refresh = ( fgDisplay.DisplayModeClock * 1000 ) /
475 ( fgDisplay.DisplayMode.htotal * fgDisplay.DisplayMode.vtotal );
477 fgState.GameModeRefresh = refresh;
480 /* query all possible display modes */
481 if( !XF86VidModeGetAllModeLines(
487 fgWarning( "XF86VidModeGetAllModeLines failed" );
493 * Check every of the modes looking for one that matches our demands,
494 * ignoring the refresh rate if no exact match could be found.
496 i = fghCheckDisplayModes( GL_TRUE, displayModesCount, displayModes );
498 i = fghCheckDisplayModes( GL_FALSE, displayModesCount, displayModes );
500 success = ( i < 0 ) ? GL_FALSE : GL_TRUE;
502 if( !haveToTest && success ) {
503 if( !XF86VidModeSwitchToMode(
506 displayModes[ i ] ) )
507 fgWarning( "XF86VidModeSwitchToMode failed" );
510 XFree( displayModes );
516 #elif TARGET_HOST_MS_WINDOWS
519 char *fggmstr = NULL;
520 char displayMode[300];
524 EnumDisplaySettings( fgDisplay.DisplayName, -1, &devMode );
525 devMode.dmFields = 0;
527 if (fgState.GameModeSize.X!=-1)
529 devMode.dmPelsWidth = fgState.GameModeSize.X;
530 devMode.dmFields |= DM_PELSWIDTH;
532 if (fgState.GameModeSize.Y!=-1)
534 devMode.dmPelsHeight = fgState.GameModeSize.Y;
535 devMode.dmFields |= DM_PELSHEIGHT;
537 if (fgState.GameModeDepth!=-1)
539 devMode.dmBitsPerPel = fgState.GameModeDepth;
540 devMode.dmFields |= DM_BITSPERPEL;
542 if (fgState.GameModeRefresh!=-1)
544 devMode.dmDisplayFrequency = fgState.GameModeRefresh;
545 devMode.dmFields |= DM_DISPLAYFREQUENCY;
548 switch ( ChangeDisplaySettingsEx(fgDisplay.DisplayName, &devMode, NULL, haveToTest ? CDS_TEST : CDS_FULLSCREEN , NULL) )
550 case DISP_CHANGE_SUCCESSFUL:
555 /* update vars in case if windows switched to proper mode */
556 EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, &devMode );
557 fgState.GameModeSize.X = devMode.dmPelsWidth;
558 fgState.GameModeSize.Y = devMode.dmPelsHeight;
559 fgState.GameModeDepth = devMode.dmBitsPerPel;
560 fgState.GameModeRefresh = devMode.dmDisplayFrequency;
563 case DISP_CHANGE_RESTART:
564 fggmstr = "The computer must be restarted for the graphics mode to work.";
566 case DISP_CHANGE_BADFLAGS:
567 fggmstr = "An invalid set of flags was passed in.";
569 case DISP_CHANGE_BADPARAM:
570 fggmstr = "An invalid parameter was passed in. This can include an invalid flag or combination of flags.";
572 case DISP_CHANGE_FAILED:
573 fggmstr = "The display driver failed the specified graphics mode.";
575 case DISP_CHANGE_BADMODE:
576 fggmstr = "The graphics mode is not supported.";
579 fggmstr = "Unknown error in graphics mode???"; /* dunno if it is possible,MSDN does not mention any other error */
585 /* I'd rather get info whats going on in my program than wonder about */
586 /* magic happenings behind my back, its lib for devels at last ;) */
588 /* append display mode to error to make things more informative */
589 sprintf(displayMode,"%s Problem with requested mode: %ix%i:%i@%i", fggmstr, devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel, devMode.dmDisplayFrequency);
590 fgWarning(displayMode);
598 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
601 * Sets the game mode display string
603 void FGAPIENTRY glutGameModeString( const char* string )
605 int width = -1, height = -1, depth = -1, refresh = -1;
607 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGameModeString" );
610 * This one seems a bit easier than glutInitDisplayString. The bad thing
611 * about it that I was unable to find the game mode string definition, so
612 * that I assumed it is: "[width]x[height]:[depth]@[refresh rate]", which
613 * appears in all GLUT game mode programs I have seen to date.
615 if( sscanf( string, "%ix%i:%i@%i", &width, &height, &depth, &refresh ) !=
617 if( sscanf( string, "%ix%i:%i", &width, &height, &depth ) != 3 )
618 if( sscanf( string, "%ix%i@%i", &width, &height, &refresh ) != 3 )
619 if( sscanf( string, "%ix%i", &width, &height ) != 2 )
620 if( sscanf( string, ":%i@%i", &depth, &refresh ) != 2 )
621 if( sscanf( string, ":%i", &depth ) != 1 )
622 if( sscanf( string, "@%i", &refresh ) != 1 )
624 "unable to parse game mode string `%s'",
628 /* All values not specified are now set to -1, which means those
629 * aspects of the current display mode are not changed in
630 * fghChangeDisplayMode() above.
632 fgState.GameModeSize.X = width;
633 fgState.GameModeSize.Y = height;
634 fgState.GameModeDepth = depth;
635 fgState.GameModeRefresh = refresh;
641 * Enters the game mode
643 int FGAPIENTRY glutEnterGameMode( void )
645 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutEnterGameMode" );
647 if( fgStructure.GameModeWindow )
648 fgAddToWindowDestroyList( fgStructure.GameModeWindow );
652 if( ! fghChangeDisplayMode( GL_FALSE ) )
654 fgWarning( "failed to change screen settings" );
658 fgStructure.GameModeWindow = fgCreateWindow(
659 NULL, "FREEGLUT", GL_TRUE, 0, 0,
660 GL_TRUE, fgState.GameModeSize.X, fgState.GameModeSize.Y,
664 fgStructure.GameModeWindow->State.Width = fgState.GameModeSize.X;
665 fgStructure.GameModeWindow->State.Height = fgState.GameModeSize.Y;
666 fgStructure.GameModeWindow->State.NeedToResize = GL_TRUE;
668 #if TARGET_HOST_POSIX_X11
671 * Sync needed to avoid a real race, the Xserver must have really created
672 * the window before we can grab the pointer into it:
674 XSync( fgDisplay.Display, False );
676 * Grab the pointer to confine it into the window after the calls to
677 * XWrapPointer() which ensure that the pointer really enters the window.
679 * We also need to wait here until XGrabPointer() returns GrabSuccess,
680 * otherwise the new window is not viewable yet and if the next function
681 * (XSetInputFocus) is called with a not yet viewable window, it will exit
682 * the application which we have to aviod, so wait until it's viewable:
684 while( GrabSuccess != XGrabPointer(
685 fgDisplay.Display, fgStructure.GameModeWindow->Window.Handle,
687 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
689 GrabModeAsync, GrabModeAsync,
690 fgStructure.GameModeWindow->Window.Handle, None, CurrentTime) )
693 * Change input focus to the new window. This will exit the application
694 * if the new window is not viewable yet, see the XGrabPointer loop above.
698 fgStructure.GameModeWindow->Window.Handle,
703 /* Move the Pointer to the middle of the fullscreen window */
707 fgDisplay.RootWindow,
709 fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
712 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
714 if( fgDisplay.DisplayModeValid )
719 /* Change to viewport to the window topleft edge: */
720 if( !XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 ) )
721 fgWarning( "XF86VidModeSetViewPort failed" );
724 * Final window repositioning: It could be avoided using an undecorated
725 * window using override_redirect, but this * would possily require
726 * more changes and investigation.
729 /* Get the current postion of the drawable area on screen */
730 XTranslateCoordinates(
732 fgStructure.CurrentWindow->Window.Handle,
733 fgDisplay.RootWindow,
738 /* Move the decorataions out of the topleft corner of the display */
739 XMoveWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle,
745 /* Grab the keyboard, too */
748 fgStructure.GameModeWindow->Window.Handle,
750 GrabModeAsync, GrabModeAsync,
756 return fgStructure.GameModeWindow->ID;
760 * Leaves the game mode
762 void FGAPIENTRY glutLeaveGameMode( void )
764 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutLeaveGameMode" );
766 freeglut_return_if_fail( fgStructure.GameModeWindow );
768 fgAddToWindowDestroyList( fgStructure.GameModeWindow );
769 fgStructure.GameModeWindow = NULL;
771 #if TARGET_HOST_POSIX_X11
773 XUngrabPointer( fgDisplay.Display, CurrentTime );
774 XUngrabKeyboard( fgDisplay.Display, CurrentTime );
782 * Returns information concerning the freeglut game mode
784 int FGAPIENTRY glutGameModeGet( GLenum eWhat )
786 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGameModeGet" );
790 case GLUT_GAME_MODE_ACTIVE:
791 return !!fgStructure.GameModeWindow;
793 case GLUT_GAME_MODE_POSSIBLE:
794 return fghChangeDisplayMode( GL_TRUE );
796 case GLUT_GAME_MODE_WIDTH:
797 return fgState.GameModeSize.X;
799 case GLUT_GAME_MODE_HEIGHT:
800 return fgState.GameModeSize.Y;
802 case GLUT_GAME_MODE_PIXEL_DEPTH:
803 return fgState.GameModeDepth;
805 case GLUT_GAME_MODE_REFRESH_RATE:
806 return fgState.GameModeRefresh;
808 case GLUT_GAME_MODE_DISPLAY_CHANGED:
810 * This is true if the game mode has been activated successfully..
812 return !!fgStructure.GameModeWindow;
815 fgWarning( "Unknown gamemode get: %d", eWhat );
819 /*** END OF FILE ***/