made fghVisibility more intuitive, documented glutVisibilityfunc and
authorDiederick Niehorster <dcnieho@gmail.com>
Fri, 1 Mar 2013 02:42:14 +0000 (02:42 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Fri, 1 Mar 2013 02:42:14 +0000 (02:42 +0000)
glutWindowStatusFunc

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1534 7f0cb862-5218-0410-a997-914c9d46530a

src/fg_callbacks.c

index 9451af0..01b256e 100644 (file)
@@ -168,14 +168,18 @@ void FGAPIENTRY glutDisplayFunc( FGCBDisplay callback )
  */
 static void fghVisibility( int status )
 {
-    int glut_status = GLUT_VISIBLE;
+    int vis_status;
 
     FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Visibility Callback" );
     freeglut_return_if_fail( fgStructure.CurrentWindow );
 
+    /* Translate window status func states to visibility states */
     if( ( GLUT_HIDDEN == status )  || ( GLUT_FULLY_COVERED == status ) )
-        glut_status = GLUT_NOT_VISIBLE;
-    INVOKE_WCB( *( fgStructure.CurrentWindow ), Visibility, ( glut_status ) );
+        vis_status = GLUT_NOT_VISIBLE;
+    else    /* GLUT_FULLY_RETAINED, GLUT_PARTIALLY_RETAINED */
+        vis_status = GLUT_VISIBLE;
+
+    INVOKE_WCB( *( fgStructure.CurrentWindow ), Visibility, ( vis_status ) );
 }
 
 void FGAPIENTRY glutVisibilityFunc( FGCBVisibility callback )