if user opens menu in parent window and then clicked child window, the menu wasn...
[freeglut] / src / fg_state.c
index 734a57c..9ddfdd9 100644 (file)
@@ -115,6 +115,11 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
       fgState.SkipStaleMotion = value;
       break;
 
+    case GLUT_GEOMETRY_VISUALIZE_NORMALS:
+      if( fgStructure.CurrentWindow != NULL )
+        fgStructure.CurrentWindow->State.VisualizeNormals = value;
+      break;
+
     default:
         fgWarning( "glutSetOption(): missing enum handle %d", eWhat );
         break;
@@ -131,6 +136,12 @@ int FGAPIENTRY glutGet( GLenum eWhat )
     case GLUT_INIT_STATE:
         return fgState.Initialised;
 
+    /* Although internally the time store is 64bits wide, the return value
+     * here still wraps every 49.7 days. Integer overflows cancel however
+     * when subtracting an initial start time, unless the total time exceeds
+     * 32-bit, so you can still work with this.
+     * XXX: a glutGet64 to return the time might be an idea...
+     */
     case GLUT_ELAPSED_TIME:
         return (int) fgElapsedTime();
     }
@@ -205,6 +216,11 @@ int FGAPIENTRY glutGet( GLenum eWhat )
     case GLUT_SKIP_STALE_MOTION_EVENTS:
       return fgState.SkipStaleMotion;
 
+    case GLUT_GEOMETRY_VISUALIZE_NORMALS:
+      if( fgStructure.CurrentWindow == NULL )
+        return GL_FALSE;
+      return fgStructure.CurrentWindow->State.VisualizeNormals;
+
     default:
         return fgPlatformGlutGet ( eWhat );
         break;