/*
* 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?
*/
/*
* ...then we've got to correct the results we've just received...
*/
- if ( fgStructure.Window->Parent == NULL )
+ if (fgStructure.GameMode != fgStructure.Window &&
+ fgStructure.Window->Parent == NULL )
{
winRect.left += GetSystemMetrics( SM_CXSIZEFRAME );
winRect.right -= GetSystemMetrics( SM_CXSIZEFRAME );