Visibility functions better implemented now. All goes through
[freeglut] / src / x11 / fg_window_x11.c
index 61a3bd6..6f927c2 100644 (file)
@@ -32,6 +32,8 @@
 #include <unistd.h>  /* usleep */
 #include "../fg_internal.h"
 
+extern void fghRedrawWindow(SFG_Window *window);
+
 #ifdef EGL_VERSION_1_0
 #include "egl/fg_window_egl.h"
 #define fghCreateNewContext fghCreateNewContextEGL
@@ -370,6 +372,26 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
 
 
 /*
+ * Request a window resize
+ */
+void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
+{
+    XResizeWindow( fgDisplay.pDisplay.Display, window->Window.Handle,
+                   width, height );
+    XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */
+}
+
+
+/*
+ * A static helper function to execute display callback for a window
+ */
+void fgPlatformDisplayWindow ( SFG_Window *window )
+{
+        fghRedrawWindow ( window ) ;
+}
+
+
+/*
  * Closes a window, destroying the frame and OpenGL context
  */
 void fgPlatformCloseWindow( SFG_Window* window )
@@ -421,6 +443,8 @@ void fgPlatformGlutIconifyWindow( void )
     XIconifyWindow( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle,
                     fgDisplay.pDisplay.Screen );
     XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */
+
+    fgStructure.CurrentWindow->State.Visible   = GL_FALSE;
 }
 
 /*