SFG_State fgState = { { -1, -1, FALSE }, /* Position */
{ 300, 300, TRUE }, /* Size */
GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH, /* DisplayMode */
+ FALSE, /* Initalized */
FALSE, /* ForceDirectContext */
TRUE, /* TryDirectContext */
FALSE, /* ForceIconic */
#endif
fgJoystickInit( 0 );
+
+ fgState.Initalized = GL_TRUE;
}
/*
{
SFG_Timer *timer;
- if( !fgState.Time.Set )
+ if( !fgState.Initalized )
{
- fgWarning( "fgDeinitialize(): fgState.Timer is null => "
- "no valid initialization has been performed" );
+ fgWarning( "fgDeinitialize(): "
+ "no valid initialization has been performed" );
return;
}
+ fgState.Initalized = GL_FALSE;
+
/*
* If there was a menu created, destroy the rendering context
*/
if( !fgState.ProgramName )
fgError ("Could not allocate space for the program's name.");
- if( fgState.Time.Set )
+ if( fgState.Initalized )
fgError( "illegal glutInit() reinitialization attemp" );
fgCreateStructure( );
-#if TARGET_HOST_UNIX_X11
- gettimeofday( &fgState.Time.Value, NULL );
-#elif TARGET_HOST_WIN32
- fgState.Time.Value = timeGetTime( );
-#endif
- fgState.Time.Set = TRUE;
+ fgElapsedTime( );
/* check if GLUT_FPS env var is set */
{