#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:
#elif TARGET_HOST_WIN32
- DEVMODE devMode;
+/* DEVMODE devMode; */
/*
* Grab the current desktop settings...
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...
*/
unsigned int displayModes = 0, mode = 0xffffffff;
GLboolean success = FALSE;
- HDC desktopDC;
+/* HDC desktopDC; */
DEVMODE devMode;
/*
* Enumerate the available display modes
+ * Try to get a complete match
*/
while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
{
* Does the enumerated display mode match the user's preferences?
*/
if( fghCheckDisplayMode( devMode.dmPelsWidth, devMode.dmPelsHeight,
- devMode.dmBitsPerPel, fgState.GameModeRefresh ) )
+ devMode.dmBitsPerPel, devMode.dmDisplayFrequency ) )
{
/*
* OKi, we've found a matching display mode, remember its number and break
displayModes++;
}
+ if ( mode == 0xffffffff )
+ {
+ /* then try without Display Frequency */
+ displayModes = 0;
+
+ /*
+ * Enumerate the available display modes
+ */
+ while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
+ {
+ /* then try without Display Frequency */
+
+ if( fghCheckDisplayMode( devMode.dmPelsWidth, devMode.dmPelsHeight,
+ devMode.dmBitsPerPel, fgState.GameModeRefresh))
+ {
+ /*
+ * OKi, we've found a matching display mode, remember its number and break
+ */
+ mode = displayModes;
+ break;
+ }
+
+ /*
+ * Switch to the next display mode, if any
+ */
+ displayModes++;
+ }
+ }
+
/*
* Did we find a matching display mode?
*/