Windows patches (Eero Pajarre)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@89 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
brianp 2003-06-20 14:39:16 +00:00
parent 2cbefc0703
commit fe2a9753bb
2 changed files with 33 additions and 2 deletions

View File

@ -255,6 +255,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
/*
* Enumerate the available display modes
* Try to get a complete match
*/
while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
{
@ -262,7 +263,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
* 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
@ -277,6 +278,35 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
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?
*/

View File

@ -364,7 +364,8 @@ int FGAPIENTRY glutGet( GLenum eWhat )
/*
* ...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 );