Adding "glutFullScreenToggle" for X11 -- still needs implementation in Windows (e...
[freeglut] / src / freeglut_state.c
index cca7b92..cafdfb9 100644 (file)
@@ -64,6 +64,30 @@ static int fghGetConfig( int attribute )
 }
 #endif
 
+/* Check if the window is in full screen state. */
+static int fghCheckFullScreen(void)
+{
+#if TARGET_HOST_POSIX_X11
+
+  int result;
+
+  result = 0;
+  if (fgDisplay.StateFullScreen != None)
+    {
+      result = fgHintPresent(fgStructure.CurrentWindow->Window.Handle,
+                            fgDisplay.State,
+                            fgDisplay.StateFullScreen);
+    }
+
+  return result;
+
+#else
+
+  return 0;
+
+#endif
+}
+
 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
 
 /*
@@ -512,6 +536,10 @@ int FGAPIENTRY glutGet( GLenum eWhat )
         return fgState.DirectContext;
         break;
 
+    case GLUT_FULL_SCREEN:
+        return fghCheckFullScreen();
+        break;
+
     default:
         fgWarning( "glutGet(): missing enum handle %d", eWhat );
         break;