Improved window positioning.
[freeglut] / freeglut-1.3 / freeglut_main.c
index 1d98edd..b002dab 100644 (file)
@@ -139,7 +139,7 @@ static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator )
     /*
      * Check if there is an idle callback hooked
      */
-// #   warning there is a redisplay hack here (see the code commented out)
+#   warning there is a redisplay hack here (see the code commented out)
     if( (window->Callbacks.Display != NULL) &&
         /*(window->State.Redisplay == TRUE) &&*/
         (window->State.Visible == TRUE) )
@@ -313,6 +313,7 @@ static void fghCheckTimers( void )
  */
 long fgElapsedTime( void )
 {
+#ifndef WIN32
        struct timeval now;
        long elapsed;
 
@@ -322,6 +323,9 @@ long fgElapsedTime( void )
        elapsed += (now.tv_sec - fgState.Time.Value.tv_sec) * 1000;
 
        return( elapsed );
+#else
+        return (timeGetTime() - fgState.Time.Value);
+#endif
 }
 
 /*
@@ -826,7 +830,7 @@ void FGAPIENTRY glutMainLoop( void )
 
 #elif TARGET_HOST_WIN32
 
-    gboolean bLoop = TRUE;
+    GLboolean bLoop = TRUE;
     MSG stMsg;
 
     /*
@@ -910,7 +914,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
          * The window structure is passed as the creation structure paramter...
          */
         window = (SFG_Window *) (((LPCREATESTRUCT) lParam)->lpCreateParams);
-        g_assert( window != NULL );
+        assert( window != NULL );
 
         /*
          * We can safely store the window's handle now:
@@ -1068,8 +1072,8 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
     case WM_MBUTTONUP:
     case WM_RBUTTONUP:
     {
-        gboolean pressed = TRUE;
-        gint button;
+        GLboolean pressed = TRUE;
+        int button;
 
         /*
          * A mouse button has been pressed *or* released. Again, break off
@@ -1181,7 +1185,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
     case WM_SYSKEYDOWN:
     case WM_KEYDOWN:
     {
-        gint keypress = -1;
+        int keypress = -1;
 
         /*
          * First of all, make sure that there is a window to be notified of this