Fix spelling mistake in a variable name.
[freeglut] / src / freeglut_state.c
index 70d7eaf..8319b5f 100644 (file)
@@ -29,8 +29,6 @@
 #include "config.h"
 #endif
 
-#define  G_LOG_DOMAIN  "freeglut-state"
-
 #include "../include/GL/freeglut.h"
 #include "freeglut_internal.h"
 
@@ -107,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:
@@ -129,8 +127,14 @@ int FGAPIENTRY glutGet( GLenum eWhat )
     int returnValue ;
     GLboolean boolValue ;
 
-    if ( eWhat == GLUT_INIT_STATE )
-        return ( fgState.Time.Set ) ;
+    switch (eWhat)
+    {
+    case GLUT_INIT_STATE:
+        return ( fgState.Initialised ) ;
+
+    case GLUT_ELAPSED_TIME:
+        return( fgElapsedTime() );
+    }
 
     freeglut_assert_ready;
 
@@ -139,9 +143,6 @@ int FGAPIENTRY glutGet( GLenum eWhat )
      */
     switch( eWhat )
     {
-    case GLUT_ELAPSED_TIME:
-        return( fgElapsedTime() );
-
     /*
      * Following values are stored in fgState and fgDisplay global structures
      */
@@ -399,7 +400,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 )
@@ -560,16 +562,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 );
 }
 
 /*
@@ -619,7 +618,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: