implement handling of GLDebugSwitch: we use glutReportErrors to check for errors in each iteration of the glut mainloop if requested

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1641 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2014-01-22 10:09:57 +00:00
parent 2b5292bb4f
commit e8d8bdf9e3

View File

@ -465,6 +465,13 @@ void FGAPIENTRY glutMainLoopEvent( void )
/* Perform work on the window (position, reshape, display, etc) */
fghProcessWork( );
/* Check OpenGL error state if requested.
* Don't call if no more open windows (can happen if user closes window from
* title bar), would lead to infinite error loop in glutReportErrors
*/
if (fgState.GLDebugSwitch && fgStructure.CurrentWindow)
glutReportErrors( );
fgCloseWindows( );
}