Updating last edit time and FreeGLUT version for API document
[freeglut] / src / mswin / fg_main_mswin.c
index 9617875..a74ee6d 100644 (file)
@@ -128,10 +128,12 @@ void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
 
 void fgPlatformDisplayWindow ( SFG_Window *window )
 {
-    RedrawWindow(
+    int success = RedrawWindow(
         window->Window.Handle, NULL, NULL,
         RDW_NOERASE | RDW_INTERNALPAINT | RDW_INVALIDATE | RDW_UPDATENOW
     );
+
+    printf("RedrawWindow (window %p): %i\n",window,success);
 }
 
 
@@ -269,7 +271,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
         if (hwnd)   /* can be NULL if mouse outside parent by the time we get here */
         {
             temp_window = fgWindowByHandle(hwnd);
-            if (temp_window->Parent)    /* Verify we got a child window */
+            if (temp_window && temp_window->Parent)    /* Verify we got a child window */
                 child_window = temp_window;
         }
     }
@@ -409,6 +411,9 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
         }
 
 #endif /* defined(_WIN32_WCE) */
+
+        window->State.Redisplay = GL_TRUE;
+        printf("create set redisplay\n");
         break;
 
     case WM_SIZE:
@@ -523,6 +528,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
 
     case WM_PAINT:
         /* Turn on the visibility in case it was turned off somehow */
+        printf("WM_PAINT received\n");
         window->State.Visible = GL_TRUE;
         InvalidateRect( hWnd, NULL, GL_FALSE ); /* Make sure whole window is repainted. Bit of a hack, but a safe one from what google turns up... */
         BeginPaint( hWnd, &ps );