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 && ver_minor >= 1;
63 /* this loop is only so that the whole thing will be repeated if someone
64 * else changes video mode between our query the current information and
65 * the attempt to change it.
68 XRRScreenSize *ssizes;
71 int i, ssizes_count, rates_count, curr, res_idx = -1;
72 Time timestamp, cfg_timestamp;
75 XRRFreeScreenConfigInfo(xrr_config);
78 if(!(xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) {
79 fgWarning("XRRGetScreenInfo failed");
82 ssizes = XRRConfigSizes(xrr_config, &ssizes_count);
83 curr = XRRConfigCurrentConfiguration(xrr_config, &rot);
84 timestamp = XRRConfigTimes(xrr_config, &cfg_timestamp);
86 /* if either of xsz or ysz are unspecified, use the current values */
88 xsz = fgState.GameModeSize.X = ssizes[curr].width;
90 ysz = fgState.GameModeSize.Y = ssizes[curr].height;
93 if(xsz == ssizes[curr].width && ysz == ssizes[curr].height) {
94 /* no need to switch, we're already in the requested resolution */
97 for(i=0; i<ssizes_count; i++) {
98 if(ssizes[i].width == xsz && ssizes[i].height == ysz) {
100 break; /* found it */
105 break; /* no matching resolution */
107 #if RANDR_MAJOR >= 1 && RANDR_MINOR >= 1
109 fgState.GameModeRefresh = XRRConfigCurrentRate(xrr_config);
113 rate = fgState.GameModeRefresh;
115 /* for the selected resolution, let's find out if there is
116 * a matching refresh rate available.
118 rates = XRRConfigRates(xrr_config, res_idx, &rates_count);
120 for(i=0; i<rates_count; i++) {
121 if(rates[i] == rate) {
125 if(i == rates_count) {
126 break; /* no matching rate */
136 #if RANDR_MAJOR >= 1 && RANDR_MINOR >= 1
138 result = XRRSetScreenConfigAndRate(fgDisplay.Display, xrr_config,
139 fgDisplay.RootWindow, res_idx, rot, rate, timestamp);
142 result = XRRSetScreenConfig(fgDisplay.Display, xrr_config,
143 fgDisplay.RootWindow, res_idx, rot, timestamp);
145 } while(result == RRSetConfigInvalidTime);
148 XRRFreeScreenConfigInfo(xrr_config);
155 #endif /* HAVE_X11_EXTENSIONS_XRANDR_H */
158 #endif /* TARGET_HOST_POSIX_X11 */
161 * Remembers the current visual settings, so that
162 * we can change them and restore later...
164 static void fghRememberState( void )
166 #if TARGET_HOST_POSIX_X11
167 int event_base, error_base;
170 * Remember the current pointer location before going fullscreen
171 * for restoring it later:
174 unsigned int junk_mask;
176 XQueryPointer(fgDisplay.Display, fgDisplay.RootWindow,
177 &junk_window, &junk_window,
178 &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY,
179 &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &junk_mask);
181 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
182 if(XRRQueryExtension(fgDisplay.Display, &event_base, &error_base)) {
183 XRRScreenConfiguration *xrr_config;
184 XRRScreenSize *ssizes;
186 int ssize_count, curr;
188 if((xrr_config = XRRGetScreenInfo(fgDisplay.Display, fgDisplay.RootWindow))) {
189 ssizes = XRRConfigSizes(xrr_config, &ssize_count);
190 curr = XRRConfigCurrentConfiguration(xrr_config, &rot);
192 fgDisplay.prev_xsz = ssizes[curr].width;
193 fgDisplay.prev_ysz = ssizes[curr].height;
194 fgDisplay.prev_refresh = -1;
196 # if RANDR_MAJOR >= 1 && RANDR_MINOR >= 1
197 if(fgState.GameModeRefresh != -1) {
198 fgDisplay.prev_refresh = XRRConfigCurrentRate(xrr_config);
202 fgDisplay.prev_size_valid = 1;
204 XRRFreeScreenConfigInfo(xrr_config);
210 * This highly depends on the XFree86 extensions,
211 * not approved as X Consortium standards
213 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
214 if(!XF86VidModeQueryExtension(fgDisplay.Display, &event_base, &error_base)) {
219 * Remember the current ViewPort location of the screen to be able to
220 * restore the ViewPort on LeaveGameMode():
222 if( !XF86VidModeGetViewPort(
225 &fgDisplay.DisplayViewPortX,
226 &fgDisplay.DisplayViewPortY ) )
227 fgWarning( "XF86VidModeGetViewPort failed" );
230 /* Query the current display settings: */
231 fgDisplay.DisplayModeValid =
232 XF86VidModeGetModeLine(
235 &fgDisplay.DisplayModeClock,
236 &fgDisplay.DisplayMode
239 if( !fgDisplay.DisplayModeValid )
240 fgWarning( "XF86VidModeGetModeLine failed" );
243 #elif TARGET_HOST_MS_WINDOWS
245 /* DEVMODE devMode; */
247 /* Grab the current desktop settings... */
249 /* hack to get around my stupid cross-gcc headers */
250 #define FREEGLUT_ENUM_CURRENT_SETTINGS -1
252 EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS,
253 &fgDisplay.DisplayMode );
255 /* Make sure we will be restoring all settings needed */
256 fgDisplay.DisplayMode.dmFields |=
257 DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
263 * Restores the previously remembered visual settings
265 static void fghRestoreState( void )
267 #if TARGET_HOST_POSIX_X11
268 /* Restore the remembered pointer position: */
270 fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
271 fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
275 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
276 if(fgDisplay.prev_size_valid) {
277 if(xrandr_resize(fgDisplay.prev_xsz, fgDisplay.prev_ysz, fgDisplay.prev_refresh, 0) != -1) {
278 fgDisplay.prev_size_valid = 0;
279 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
280 fgDisplay.DisplayModeValid = 0;
289 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
291 * This highly depends on the XFree86 extensions,
292 * not approved as X Consortium standards
295 if( fgDisplay.DisplayModeValid )
297 XF86VidModeModeInfo** displayModes;
298 int i, displayModesCount;
300 if( !XF86VidModeGetAllModeLines(
306 fgWarning( "XF86VidModeGetAllModeLines failed" );
312 * Check every of the modes looking for one that matches our demands.
313 * If we find one, switch to it and restore the remembered viewport.
315 for( i = 0; i < displayModesCount; i++ )
317 if(displayModes[ i ]->hdisplay == fgDisplay.DisplayMode.hdisplay &&
318 displayModes[ i ]->vdisplay == fgDisplay.DisplayMode.vdisplay &&
319 displayModes[ i ]->dotclock == fgDisplay.DisplayModeClock )
321 if( !XF86VidModeSwitchToMode(
324 displayModes[ i ] ) )
326 fgWarning( "XF86VidModeSwitchToMode failed" );
330 if( !XF86VidModeSetViewPort(
333 fgDisplay.DisplayViewPortX,
334 fgDisplay.DisplayViewPortY ) )
335 fgWarning( "XF86VidModeSetViewPort failed" );
339 * For the case this would be the last X11 call the application
340 * calls exit() we've to flush the X11 output queue to have the
341 * commands sent to the X server before the application exits.
343 XFlush( fgDisplay.Display );
345 fgDisplay.DisplayModeValid = 0;
346 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
347 fgDisplay.prev_size_valid = 0;
353 XFree( displayModes );
358 #elif TARGET_HOST_MS_WINDOWS
360 /* Restore the previously remembered desktop display settings */
361 ChangeDisplaySettingsEx( fgDisplay.DisplayName,&fgDisplay.DisplayMode, 0,0,0 );
366 #if TARGET_HOST_POSIX_X11
367 #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
370 * Checks a single display mode settings against user's preferences.
372 static GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
374 /* The desired values should be stored in fgState structure... */
375 return ( width == fgState.GameModeSize.X ) &&
376 ( height == fgState.GameModeSize.Y ) &&
377 ( depth == fgState.GameModeDepth ) &&
378 ( refresh == fgState.GameModeRefresh );
382 * Checks all display modes settings against user's preferences.
383 * Returns the mode number found or -1 if none could be found.
385 static int fghCheckDisplayModes( GLboolean exactMatch, int displayModesCount, XF86VidModeModeInfo** displayModes )
388 for( i = 0; i < displayModesCount; i++ )
390 /* Compute the displays refresh rate, dotclock comes in kHz. */
391 int refresh = ( displayModes[ i ]->dotclock * 1000 ) /
392 ( displayModes[ i ]->htotal * displayModes[ i ]->vtotal );
394 if( fghCheckDisplayMode( displayModes[ i ]->hdisplay,
395 displayModes[ i ]->vdisplay,
396 fgState.GameModeDepth,
397 ( exactMatch ? refresh : fgState.GameModeRefresh ) ) ) {
400 /* Update the chosen refresh rate, otherwise a
401 * glutGameModeGet(GLUT_GAME_MODE_REFRESH_RATE) would not
402 * return the right values
404 fgState.GameModeRefresh = refresh;
417 * Changes the current display mode to match user's settings
419 static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
421 GLboolean success = GL_FALSE;
422 #if TARGET_HOST_POSIX_X11
424 /* first try to use XRandR, then fallback to XF86VidMode */
425 # ifdef HAVE_X11_EXTENSIONS_XRANDR_H
426 if(xrandr_resize(fgState.GameModeSize.X, fgState.GameModeSize.Y,
427 fgState.GameModeRefresh, haveToTest) != -1) {
434 * This highly depends on the XFree86 extensions,
435 * not approved as X Consortium standards
437 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
440 * This is also used by applications which check modes by calling
441 * glutGameModeGet(GLUT_GAME_MODE_POSSIBLE), so allow the check:
443 if( haveToTest || fgDisplay.DisplayModeValid )
445 XF86VidModeModeInfo** displayModes;
446 int i, displayModesCount;
448 /* If we don't have a valid modeline in the display structure, which
449 * can happen if this is called from glutGameModeGet instead of
450 * glutEnterGameMode, then we need to query the current mode, to make
451 * unspecified settings to default to their current values.
453 if(!fgDisplay.DisplayModeValid) {
454 if(!XF86VidModeGetModeLine(fgDisplay.Display, fgDisplay.Screen,
455 &fgDisplay.DisplayModeClock, &fgDisplay.DisplayMode)) {
460 if (fgState.GameModeSize.X == -1)
462 fgState.GameModeSize.X = fgDisplay.DisplayMode.hdisplay;
464 if (fgState.GameModeSize.Y == -1)
466 fgState.GameModeSize.Y = fgDisplay.DisplayMode.vdisplay;
468 if (fgState.GameModeDepth == -1)
470 /* can't get color depth from this, nor can we change it, do nothing
471 * TODO: get with XGetVisualInfo()? but then how to set?
474 if (fgState.GameModeRefresh == -1)
476 /* Compute the displays refresh rate, dotclock comes in kHz. */
477 int refresh = ( fgDisplay.DisplayModeClock * 1000 ) /
478 ( fgDisplay.DisplayMode.htotal * fgDisplay.DisplayMode.vtotal );
480 fgState.GameModeRefresh = refresh;
483 /* query all possible display modes */
484 if( !XF86VidModeGetAllModeLines(
490 fgWarning( "XF86VidModeGetAllModeLines failed" );
496 * Check every of the modes looking for one that matches our demands,
497 * ignoring the refresh rate if no exact match could be found.
499 i = fghCheckDisplayModes( GL_TRUE, displayModesCount, displayModes );
501 i = fghCheckDisplayModes( GL_FALSE, displayModesCount, displayModes );
503 success = ( i < 0 ) ? GL_FALSE : GL_TRUE;
505 if( !haveToTest && success ) {
506 if( !XF86VidModeSwitchToMode(
509 displayModes[ i ] ) )
510 fgWarning( "XF86VidModeSwitchToMode failed" );
513 XFree( displayModes );
519 #elif TARGET_HOST_MS_WINDOWS
522 char *fggmstr = NULL;
523 char displayMode[300];
527 EnumDisplaySettings( fgDisplay.DisplayName, -1, &devMode );
528 devMode.dmFields = 0;
530 if (fgState.GameModeSize.X!=-1)
532 devMode.dmPelsWidth = fgState.GameModeSize.X;
533 devMode.dmFields |= DM_PELSWIDTH;
535 if (fgState.GameModeSize.Y!=-1)
537 devMode.dmPelsHeight = fgState.GameModeSize.Y;
538 devMode.dmFields |= DM_PELSHEIGHT;
540 if (fgState.GameModeDepth!=-1)
542 devMode.dmBitsPerPel = fgState.GameModeDepth;
543 devMode.dmFields |= DM_BITSPERPEL;
545 if (fgState.GameModeRefresh!=-1)
547 devMode.dmDisplayFrequency = fgState.GameModeRefresh;
548 devMode.dmFields |= DM_DISPLAYFREQUENCY;
551 switch ( ChangeDisplaySettingsEx(fgDisplay.DisplayName, &devMode, NULL, haveToTest ? CDS_TEST : CDS_FULLSCREEN , NULL) )
553 case DISP_CHANGE_SUCCESSFUL:
558 /* update vars in case if windows switched to proper mode */
559 EnumDisplaySettings( fgDisplay.DisplayName, FREEGLUT_ENUM_CURRENT_SETTINGS, &devMode );
560 fgState.GameModeSize.X = devMode.dmPelsWidth;
561 fgState.GameModeSize.Y = devMode.dmPelsHeight;
562 fgState.GameModeDepth = devMode.dmBitsPerPel;
563 fgState.GameModeRefresh = devMode.dmDisplayFrequency;
566 case DISP_CHANGE_RESTART:
567 fggmstr = "The computer must be restarted for the graphics mode to work.";
569 case DISP_CHANGE_BADFLAGS:
570 fggmstr = "An invalid set of flags was passed in.";
572 case DISP_CHANGE_BADPARAM:
573 fggmstr = "An invalid parameter was passed in. This can include an invalid flag or combination of flags.";
575 case DISP_CHANGE_FAILED:
576 fggmstr = "The display driver failed the specified graphics mode.";
578 case DISP_CHANGE_BADMODE:
579 fggmstr = "The graphics mode is not supported.";
582 fggmstr = "Unknown error in graphics mode???"; /* dunno if it is possible,MSDN does not mention any other error */
588 /* I'd rather get info whats going on in my program than wonder about */
589 /* magic happenings behind my back, its lib for devels at last ;) */
591 /* append display mode to error to make things more informative */
592 sprintf(displayMode,"%s Problem with requested mode: %ix%i:%i@%i", fggmstr, devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel, devMode.dmDisplayFrequency);
593 fgWarning(displayMode);
601 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
604 * Sets the game mode display string
606 void FGAPIENTRY glutGameModeString( const char* string )
608 int width = -1, height = -1, depth = -1, refresh = -1;
610 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGameModeString" );
613 * This one seems a bit easier than glutInitDisplayString. The bad thing
614 * about it that I was unable to find the game mode string definition, so
615 * that I assumed it is: "[width]x[height]:[depth]@[refresh rate]", which
616 * appears in all GLUT game mode programs I have seen to date.
618 if( sscanf( string, "%ix%i:%i@%i", &width, &height, &depth, &refresh ) !=
620 if( sscanf( string, "%ix%i:%i", &width, &height, &depth ) != 3 )
621 if( sscanf( string, "%ix%i@%i", &width, &height, &refresh ) != 3 )
622 if( sscanf( string, "%ix%i", &width, &height ) != 2 )
623 if( sscanf( string, ":%i@%i", &depth, &refresh ) != 2 )
624 if( sscanf( string, ":%i", &depth ) != 1 )
625 if( sscanf( string, "@%i", &refresh ) != 1 )
627 "unable to parse game mode string `%s'",
631 /* All values not specified are now set to -1, which means those
632 * aspects of the current display mode are not changed in
633 * fghChangeDisplayMode() above.
635 fgState.GameModeSize.X = width;
636 fgState.GameModeSize.Y = height;
637 fgState.GameModeDepth = depth;
638 fgState.GameModeRefresh = refresh;
644 * Enters the game mode
646 int FGAPIENTRY glutEnterGameMode( void )
648 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutEnterGameMode" );
650 if( fgStructure.GameModeWindow )
651 fgAddToWindowDestroyList( fgStructure.GameModeWindow );
655 if( ! fghChangeDisplayMode( GL_FALSE ) )
657 fgWarning( "failed to change screen settings" );
661 fgStructure.GameModeWindow = fgCreateWindow(
662 NULL, "FREEGLUT", GL_TRUE, 0, 0,
663 GL_TRUE, fgState.GameModeSize.X, fgState.GameModeSize.Y,
667 fgStructure.GameModeWindow->State.Width = fgState.GameModeSize.X;
668 fgStructure.GameModeWindow->State.Height = fgState.GameModeSize.Y;
669 fgStructure.GameModeWindow->State.NeedToResize = GL_TRUE;
671 #if TARGET_HOST_POSIX_X11
674 * Sync needed to avoid a real race, the Xserver must have really created
675 * the window before we can grab the pointer into it:
677 XSync( fgDisplay.Display, False );
679 * Grab the pointer to confine it into the window after the calls to
680 * XWrapPointer() which ensure that the pointer really enters the window.
682 * We also need to wait here until XGrabPointer() returns GrabSuccess,
683 * otherwise the new window is not viewable yet and if the next function
684 * (XSetInputFocus) is called with a not yet viewable window, it will exit
685 * the application which we have to aviod, so wait until it's viewable:
687 while( GrabSuccess != XGrabPointer(
688 fgDisplay.Display, fgStructure.GameModeWindow->Window.Handle,
690 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
692 GrabModeAsync, GrabModeAsync,
693 fgStructure.GameModeWindow->Window.Handle, None, CurrentTime) )
696 * Change input focus to the new window. This will exit the application
697 * if the new window is not viewable yet, see the XGrabPointer loop above.
701 fgStructure.GameModeWindow->Window.Handle,
706 /* Move the Pointer to the middle of the fullscreen window */
710 fgDisplay.RootWindow,
712 fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
715 # ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
717 if( fgDisplay.DisplayModeValid )
722 /* Change to viewport to the window topleft edge: */
723 if( !XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 ) )
724 fgWarning( "XF86VidModeSetViewPort failed" );
727 * Final window repositioning: It could be avoided using an undecorated
728 * window using override_redirect, but this * would possily require
729 * more changes and investigation.
732 /* Get the current postion of the drawable area on screen */
733 XTranslateCoordinates(
735 fgStructure.CurrentWindow->Window.Handle,
736 fgDisplay.RootWindow,
741 /* Move the decorataions out of the topleft corner of the display */
742 XMoveWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle,
748 /* Grab the keyboard, too */
751 fgStructure.GameModeWindow->Window.Handle,
753 GrabModeAsync, GrabModeAsync,
759 return fgStructure.GameModeWindow->ID;
763 * Leaves the game mode
765 void FGAPIENTRY glutLeaveGameMode( void )
767 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutLeaveGameMode" );
769 freeglut_return_if_fail( fgStructure.GameModeWindow );
771 fgAddToWindowDestroyList( fgStructure.GameModeWindow );
772 fgStructure.GameModeWindow = NULL;
774 #if TARGET_HOST_POSIX_X11
776 XUngrabPointer( fgDisplay.Display, CurrentTime );
777 XUngrabKeyboard( fgDisplay.Display, CurrentTime );
785 * Returns information concerning the freeglut game mode
787 int FGAPIENTRY glutGameModeGet( GLenum eWhat )
789 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGameModeGet" );
793 case GLUT_GAME_MODE_ACTIVE:
794 return !!fgStructure.GameModeWindow;
796 case GLUT_GAME_MODE_POSSIBLE:
797 return fghChangeDisplayMode( GL_TRUE );
799 case GLUT_GAME_MODE_WIDTH:
800 return fgState.GameModeSize.X;
802 case GLUT_GAME_MODE_HEIGHT:
803 return fgState.GameModeSize.Y;
805 case GLUT_GAME_MODE_PIXEL_DEPTH:
806 return fgState.GameModeDepth;
808 case GLUT_GAME_MODE_REFRESH_RATE:
809 return fgState.GameModeRefresh;
811 case GLUT_GAME_MODE_DISPLAY_CHANGED:
813 * This is true if the game mode has been activated successfully..
815 return !!fgStructure.GameModeWindow;
818 fgWarning( "Unknown gamemode get: %d", eWhat );
822 /*** END OF FILE ***/