#define G_LOG_DOMAIN "freeglut-gamemode"
#include "../include/GL/freeglut.h"
-#include "../include/GL/freeglut_internal.h"
+#include "freeglut_internal.h"
/*
* TODO BEFORE THE STABLE RELEASE:
/*
* Grab the current desktop settings...
*/
- EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &fgDisplay.DisplayMode );
+
+/* hack to get around my stupid cross-gcc headers */
+#define FREEGLUT_ENUM_CURRENT_SETTINGS -1
+
+ EnumDisplaySettings( NULL, FREEGLUT_ENUM_CURRENT_SETTINGS, &fgDisplay.DisplayMode );
/*
* Make sure we will be restoring all settings needed
displayModes[ i ]
);
+ /*
+ * In case this will be the last X11 call we do before exit,
+ * we've to flush the X11 output queue to be sure the command
+ * is really brought onto it's way to the X server.
+ * The application should not do this because it
+ * would not be platform independent then.
+ */
+ XFlush(fgDisplay.Display);
+
return;
}
}
if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay,
fgState.GameModeDepth, fgState.GameModeRefresh ) )
{
+ if( haveToTest )
+ return( TRUE );
/*
* OKi, this is the display mode we have been looking for...
*/
#elif TARGET_HOST_WIN32
- guint displayModes = 0, mode = 0xffffffff;
- gboolean success = FALSE;
+ unsigned int displayModes = 0, mode = 0xffffffff;
+ GLboolean success = FALSE;
HDC desktopDC;
DEVMODE devMode;
devMode.dmBitsPerPel, fgState.GameModeRefresh ) )
{
/*
- * OKi, we've found a matching display mode, remember it's number and break
+ * OKi, we've found a matching display mode, remember its number and break
*/
mode = displayModes;
break;
/*
* ...if so, delete it before proceeding...
*/
- fgDestroyWindow( fgStructure.GameMode, TRUE );
+ fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
}
else
{
*/
if( fghChangeDisplayMode( FALSE ) == FALSE )
{
- fgWarning( "failed to change screen settings" );
+ fgWarning( "failed to change screen settings" );
return( FALSE );
}
freeglut_return_if_fail( fgStructure.GameMode != NULL );
/*
- * First of all, have the game mode window created
+ * First of all, have the game mode window destroyed
*/
- fgDestroyWindow( fgStructure.GameMode, TRUE );
+ fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
#if TARGET_HOST_UNIX_X11