+/*\r
+ * This function hides the current window\r
+ */\r
+void fgPlatformGlutHideWindow( void )\r
+{\r
+ if( fgStructure.CurrentWindow->Parent == NULL )\r
+ XWithdrawWindow( fgDisplay.pDisplay.Display,\r
+ fgStructure.CurrentWindow->Window.Handle,\r
+ fgDisplay.pDisplay.Screen );\r
+ else\r
+ XUnmapWindow( fgDisplay.pDisplay.Display,\r
+ fgStructure.CurrentWindow->Window.Handle );\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
+}\r
+\r
+/*\r
+ * Iconify the current window (top-level windows only)\r
+ */\r
+void fgPlatformGlutIconifyWindow( void )\r
+{\r
+ XIconifyWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle,\r
+ fgDisplay.pDisplay.Screen );\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
+}\r
+\r
+/*\r
+ * Set the current window's title\r
+ */\r
+void fgPlatformGlutSetWindowTitle( const char* title )\r
+{\r
+ XTextProperty text;\r
+\r
+ text.value = (unsigned char *) title;\r
+ text.encoding = XA_STRING;\r
+ text.format = 8;\r
+ text.nitems = strlen( title );\r
+\r
+ XSetWMName(\r
+ fgDisplay.pDisplay.Display,\r
+ fgStructure.CurrentWindow->Window.Handle,\r
+ &text\r
+ );\r
+\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
+}\r
+\r
+/*\r
+ * Set the current window's iconified title\r
+ */\r
+void fgPlatformGlutSetIconTitle( const char* title )\r
+{\r
+ XTextProperty text;\r
+\r
+ text.value = (unsigned char *) title;\r
+ text.encoding = XA_STRING;\r
+ text.format = 8;\r
+ text.nitems = strlen( title );\r
+\r
+ XSetWMIconName(\r
+ fgDisplay.pDisplay.Display,\r
+ fgStructure.CurrentWindow->Window.Handle,\r
+ &text\r
+ );\r
+\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
+}\r
+\r
+/*\r
+ * Change the current window's position\r
+ */\r
+void fgPlatformGlutPositionWindow( int x, int y )\r
+{\r
+ XMoveWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle,\r
+ x, y );\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
+}\r
+\r
+/*\r
+ * Lowers the current window (by Z order change)\r
+ */\r
+void fgPlatformGlutPushWindow( void )\r
+{\r
+ XLowerWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle );\r
+}\r
+\r
+/*\r
+ * Raises the current window (by Z order change)\r
+ */\r
+void fgPlatformGlutPopWindow( void )\r
+{\r
+ XRaiseWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle );\r
+}\r
+\r
+/*\r
+ * Resize the current window so that it fits the whole screen\r
+ */\r
+void fgPlatformGlutFullScreen( SFG_Window *win )\r
+{\r
+ if(!glutGet(GLUT_FULL_SCREEN)) {\r
+ if(fghToggleFullscreen() != -1) {\r
+ win->State.IsFullscreen = GL_TRUE;\r
+ }\r
+ }\r
+}\r
+\r
+/*\r
+ * If we are fullscreen, resize the current window back to its original size\r
+ */\r
+void fgPlatformGlutLeaveFullScreen( SFG_Window *win )\r
+{\r
+ if(glutGet(GLUT_FULL_SCREEN)) {\r
+ if(fghToggleFullscreen() != -1) {\r
+ win->State.IsFullscreen = GL_FALSE;\r
+ }\r
+ }\r
+}\r
+\r
+/*\r
+ * Toggle the window's full screen state.\r
+ */\r
+void fgPlatformGlutFullScreenToggle( SFG_Window *win )\r
+{\r
+ if(fghToggleFullscreen() != -1) {\r
+ win->State.IsFullscreen = !win->State.IsFullscreen;\r
+ }\r
+}\r
+\r
+\r
+\r