xf86VidMode error checking (Andrew Lentvorski)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@112 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
8cce55439e
commit
69cbc334a9
@ -62,6 +62,7 @@ void fghRememberState( void )
|
|||||||
/*
|
/*
|
||||||
* Query the current display settings:
|
* Query the current display settings:
|
||||||
*/
|
*/
|
||||||
|
fgDisplay.DisplayModeValid =
|
||||||
XF86VidModeGetModeLine(
|
XF86VidModeGetModeLine(
|
||||||
fgDisplay.Display,
|
fgDisplay.Display,
|
||||||
fgDisplay.Screen,
|
fgDisplay.Screen,
|
||||||
@ -69,6 +70,9 @@ void fghRememberState( void )
|
|||||||
&fgDisplay.DisplayMode
|
&fgDisplay.DisplayMode
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!fgDisplay.DisplayModeValid)
|
||||||
|
fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" );
|
||||||
|
|
||||||
# else
|
# else
|
||||||
# warning fghRememberState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
# warning fghRememberState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
||||||
# endif
|
# endif
|
||||||
@ -106,6 +110,8 @@ void fghRestoreState( void )
|
|||||||
*/
|
*/
|
||||||
# ifdef X_XF86VidModeGetAllModeLines
|
# ifdef X_XF86VidModeGetAllModeLines
|
||||||
|
|
||||||
|
if (fgDisplay.DisplayModeValid)
|
||||||
|
{
|
||||||
XF86VidModeModeInfo** displayModes;
|
XF86VidModeModeInfo** displayModes;
|
||||||
int i, displayModesCount;
|
int i, displayModesCount;
|
||||||
|
|
||||||
@ -149,6 +155,7 @@ void fghRestoreState( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
# warning fghRestoreState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
# warning fghRestoreState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
||||||
@ -188,6 +195,8 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
*/
|
*/
|
||||||
# ifdef X_XF86VidModeGetAllModeLines
|
# ifdef X_XF86VidModeGetAllModeLines
|
||||||
|
|
||||||
|
if (fgDisplay.DisplayModeValid)
|
||||||
|
{
|
||||||
XF86VidModeModeInfo** displayModes;
|
XF86VidModeModeInfo** displayModes;
|
||||||
int i, displayModesCount;
|
int i, displayModesCount;
|
||||||
|
|
||||||
@ -236,6 +245,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Something must have went wrong
|
* Something must have went wrong
|
||||||
|
Reference in New Issue
Block a user