# define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
-extern void fgPlatformProcessWork ( SFG_Window *window );
+extern void fgProcessWork ( SFG_Window *window );
extern fg_time_t fgPlatformSystemTime ( void );
extern void fgPlatformSleepForEvents( fg_time_t msec );
extern void fgPlatformProcessSingleEvent ( void );
SFG_Enumerator *enumerator )
{
if( window->State.WorkMask )
- fgPlatformProcessWork ( window );
+ fgProcessWork ( window );
fgEnumSubWindows( window, fghcbProcessWork, enumerator );
}
/* Step through the work list */
-void fgPlatformProcessWork(SFG_Window *window)
+void fgProcessWork(SFG_Window *window)
{
unsigned int workMask = window->State.WorkMask;
/* Now clear it so that any callback generated by the actions below can set work again */
/* 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( );
}