void fghRedrawWindow ( SFG_Window *window )
{
SFG_Window *current_window = fgStructure.CurrentWindow;
- printf("fghRedrawWindow\n");
freeglut_return_if_fail( window );
- printf("got window\n");
if( window->State.NeedToInitContext ) {
INVOKE_WCB( *window, InitContext, ());
}
freeglut_return_if_fail( FETCH_WCB ( *window, Display ) );
- printf("got displayCB\n");
window->State.Redisplay = GL_FALSE;
freeglut_return_if_fail( window->State.Visible );
- printf("we're visible\n");
fgSetWindow( window );
);
}
- printf("invoking displayCB\n");
INVOKE_WCB( *window, Display, ( ) );
fgSetWindow( current_window );
static void fghcbDisplayWindow( SFG_Window *window,
SFG_Enumerator *enumerator )
{
- printf("window %p, %i\n",window,window->State.Redisplay);
if( window->State.Redisplay &&
window->State.Visible )
{
window->State.Redisplay = GL_FALSE;
- printf("redisplaying...\n");
fgPlatformDisplayWindow ( window );
}
/* Platform-dependent time in milliseconds, as an unsigned 64-bit integer.
* This doesn't overflow in any reasonable time, so no need to worry about
* that. The GLUT API return value will however overflow after 49.7 days,
- * and on Windows we (currently) do not have access to a 64-bit timestamp,
- * which means internal time will still get in trouble when running the
+ * which means you will still get in trouble when running the
* application for more than 49.7 days.
- * This value wraps every 49.7 days, but integer overflows cancel
- * when subtracting an initial start time, unless the total time exceeds
- * 32-bit, where the GLUT API return value is also overflowed.
*/
fg_time_t fgSystemTime(void)
{
va_end( ap );
} else {
-
+#if FREEGLUT_ERRORS
va_start( ap, fmt );
fprintf( stderr, "freeglut ");
fprintf( stderr, "\n" );
va_end( ap );
+#endif
if ( fgState.Initialised )
fgDeinitialize ();
va_end( ap );
} else {
-
+#if FREEGLUT_WARNINGS
va_start( ap, fmt );
fprintf( stderr, "freeglut ");
fprintf( stderr, "\n" );
va_end( ap );
+#endif
}
}
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" );
+ if (!fgStructure.Windows.First)
+ fgError(" ERROR: glutMainLoop called with no windows created.");
+
fgPlatformMainLoopPreliminaryWork ();
fgState.ExecState = GLUT_EXEC_STATE_RUNNING ;