All changes are from John, except for:
[freeglut] / src / freeglut_state.c
index 4b1aed8..5e4ad04 100644 (file)
@@ -105,7 +105,7 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
 
   case GLUT_RENDERING_CONTEXT:
       fgState.UseCurrentContext =
-          ( value == GLUT_USE_CURRENT_CONTEXT ) ? TRUE : FALSE;
+          ( value == GLUT_USE_CURRENT_CONTEXT ) ? GL_TRUE : GL_FALSE;
       break;
 
   case GLUT_WINDOW_CURSOR:
@@ -124,11 +124,19 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
  */
 int FGAPIENTRY glutGet( GLenum eWhat )
 {
+#if TARGET_HOST_WIN32
     int returnValue ;
     GLboolean boolValue ;
+#endif
+
+    switch (eWhat)
+    {
+    case GLUT_INIT_STATE:
+        return ( fgState.Initialised ) ;
 
-    if ( eWhat == GLUT_INIT_STATE )
-        return ( fgState.Time.Set ) ;
+    case GLUT_ELAPSED_TIME:
+        return( fgElapsedTime() );
+    }
 
     freeglut_assert_ready;
 
@@ -137,9 +145,6 @@ int FGAPIENTRY glutGet( GLenum eWhat )
      */
     switch( eWhat )
     {
-    case GLUT_ELAPSED_TIME:
-        return( fgElapsedTime() );
-
     /*
      * Following values are stored in fgState and fgDisplay global structures
      */
@@ -397,7 +402,8 @@ int FGAPIENTRY glutGet( GLenum eWhat )
         return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
 
     case GLUT_DISPLAY_MODE_POSSIBLE:
-        return( fgSetupPixelFormat( fgStructure.Window, TRUE, PFD_MAIN_PLANE ) );
+        return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
+                                    PFD_MAIN_PLANE ) );
 
     case GLUT_WINDOW_FORMAT_ID:
         if( fgStructure.Window != NULL )
@@ -558,16 +564,13 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
  */
 int FGAPIENTRY glutGetModifiers( void )
 {
-    if( fgStructure.Window == NULL )
-        return( 0 );
-
-    if( fgStructure.Window->State.Modifiers == 0xffffffff )
+    if( fgState.Modifiers == 0xffffffff )
     {
         fgWarning( "glutGetModifiers() called outside an input callback" );
         return( 0 );
     }
 
-    return( fgStructure.Window->State.Modifiers );
+    return( fgState.Modifiers );
 }
 
 /*
@@ -617,7 +620,8 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
 #elif TARGET_HOST_WIN32
 
     case GLUT_OVERLAY_POSSIBLE:
-/*        return( fgSetupPixelFormat( fgStructure.Window, TRUE, PFD_OVERLAY_PLANE ) ); */
+/*      return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
+                                    PFD_OVERLAY_PLANE ) ); */
       return FALSE ;
 
     case GLUT_LAYER_IN_USE: