- /* Create rect in FreeGLUT format, (X,Y) topleft outside window, WxH of client area */
- windowRect.right = windowRect.left+width;
- windowRect.bottom = windowRect.top+height;
-
- if (window->Parent == NULL)
- /* get the window rect from this to feed to SetWindowPos, correct for window decorations */
- fghComputeWindowRectFromClientArea_QueryWindow(window,&windowRect,TRUE);
- else
- {
- /* correct rect for position client area of parent window
- * (SetWindowPos input for child windows is in coordinates
- * relative to the parent's client area).
- * Child windows don't have decoration, so no need to correct
- * for them.
- */
- RECT parentRect;
- parentRect = fghGetClientArea( window->Parent, FALSE );
- windowRect.left -= parentRect.left;
- windowRect.right -= parentRect.left;
- windowRect.top -= parentRect.top;
- windowRect.bottom -= parentRect.top;
- }
-
- /* Do the actual resizing */
- SetWindowPos( window->Window.Handle,
- HWND_TOP,
- windowRect.left, windowRect.top,
- windowRect.right - windowRect.left,
- windowRect.bottom- windowRect.top,
- SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING |
- SWP_NOZORDER
- );
-}
-
-
-void fgPlatformDisplayWindow ( SFG_Window *window )
+/* Get system time, taking special precautions against 32bit timer wrap.
+ We use timeGetTime and not GetTickCount because of its better stability,
+ and because we can increase its granularity (to 1 ms in
+ fgPlatformInitialize). For that reason we can't use GetTickCount64 which
+ wouldn't have the wrap issue.
+ Credit: this is based on code in glibc (https://mail.gnome.org/archives/commits-list/2011-November/msg04588.html)
+ */
+static fg_time_t lastTime32 = 0;
+static fg_time_t timeEpoch = 0;
+void fgPlatformInitSystemTime()