General ChangeLog Updates
[freeglut] / src / freeglut_init.c
index 5c92464..01f2af2 100644 (file)
@@ -183,7 +183,7 @@ static void fghInitialize( const char* displayName )
 
         /* Register the window class */
         atom = RegisterClass( &wc );
-        assert( atom );
+        FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" );
     }
 
     /* The screen dimensions can be obtained via GetSystemMetrics() calls */
@@ -219,8 +219,6 @@ void fgDeinitialize( void )
         return;
     }
 
-    /* fgState.Initialised = GL_FALSE; */
-
     /* If there was a menu created, destroy the rendering context */
     if( fgStructure.MenuContext )
     {
@@ -311,6 +309,8 @@ void fgDeinitialize( void )
     XCloseDisplay( fgDisplay.Display );
 
 #endif
+
+    fgState.Initialised = GL_FALSE;
 }
 
 /*
@@ -594,11 +594,8 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
         }
     }
 
-    /*
-     * Compact {argv}.
-     */
-    j = 1;
-    for( i = 1; i < *pargc; i++, j++ )
+    /* Compact {argv}. */
+    for( i = j = 1; i < *pargc; i++, j++ )
     {
         /* Guaranteed to end because there are "*pargc" arguments left */
         while ( argv[ j ] == NULL )