Moving the Windows-specific joystick definitions into the Windows-specific header...
[freeglut] / src / mswin / freeglut_main_mswin.c
index 96ec77b..be48b23 100644 (file)
@@ -26,7 +26,7 @@
  */\r
 \r
 #include <GL/freeglut.h>\r
-#include "freeglut_internal_mswin.h"\r
+#include "../Common/freeglut_internal.h"\r
 \r
 \r
 extern void fghRedrawWindow ( SFG_Window *window );\r
@@ -35,6 +35,20 @@ extern void fgNewWGLCreateContext( SFG_Window* window );
 extern GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,\r
                                      unsigned char layer_type );\r
 \r
+#ifdef WM_TOUCH\r
+typedef BOOL (WINAPI *pGetTouchInputInfo)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);\r
+typedef BOOL (WINAPI *pCloseTouchInputHandle)(HTOUCHINPUT);\r
+static pGetTouchInputInfo fghGetTouchInputInfo = (pGetTouchInputInfo)0xDEADBEEF;\r
+static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF;\r
+#endif\r
+\r
+/* \r
+ * Helper functions for getting client area from the window rect\r
+ * and the window rect from the client area given the style of the window\r
+ * (or a valid window pointer from which the style can be queried).\r
+ */\r
+extern void fghComputeWindowRectFromClientArea_QueryWindow( const SFG_Window *window, RECT *clientRect, BOOL posIsOutside );\r
+extern RECT fghGetClientArea                              ( const SFG_Window *window,                   BOOL wantPosOutside );\r
 \r
 \r
 void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )\r
@@ -94,6 +108,16 @@ void fgPlatformDisplayWindow ( SFG_Window *window )
 }\r
 \r
 \r
+unsigned long fgPlatformSystemTime ( void )\r
+{\r
+#if defined(_WIN32_WCE)\r
+    return GetTickCount();\r
+#else\r
+    return timeGetTime();\r
+#endif\r
+}\r
+\r
+\r
 void fgPlatformSleepForEvents( long msec )\r
 {\r
     MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLINPUT );\r
@@ -315,7 +339,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                                        "fgPlatformWindowProc" );\r
 \r
         window->Window.Handle = hWnd;\r
-        window->Window.Device = GetDC( hWnd );\r
+        window->Window.pContext.Device = GetDC( hWnd );\r
         if( window->IsMenu )\r
         {\r
             unsigned int current_DisplayMode = fgState.DisplayMode;\r
@@ -326,7 +350,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             fgState.DisplayMode = current_DisplayMode;\r
 \r
             if( fgStructure.MenuContext )\r
-                wglMakeCurrent( window->Window.Device,\r
+                wglMakeCurrent( window->Window.pContext.Device,\r
                                 fgStructure.MenuContext->MContext\r
                 );\r
             else\r
@@ -334,11 +358,11 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                 fgStructure.MenuContext =\r
                     (SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) );\r
                 fgStructure.MenuContext->MContext =\r
-                    wglCreateContext( window->Window.Device );\r
+                    wglCreateContext( window->Window.pContext.Device );\r
             }\r
 \r
             /* window->Window.Context = wglGetCurrentContext ();   */\r
-            window->Window.Context = wglCreateContext( window->Window.Device );\r
+            window->Window.Context = wglCreateContext( window->Window.pContext.Device );\r
         }\r
         else\r
         {\r
@@ -348,13 +372,13 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
 \r
             if( ! fgState.UseCurrentContext )\r
                 window->Window.Context =\r
-                    wglCreateContext( window->Window.Device );\r
+                    wglCreateContext( window->Window.pContext.Device );\r
             else\r
             {\r
                 window->Window.Context = wglGetCurrentContext( );\r
                 if( ! window->Window.Context )\r
                     window->Window.Context =\r
-                        wglCreateContext( window->Window.Device );\r
+                        wglCreateContext( window->Window.pContext.Device );\r
             }\r
 \r
 #if !defined(_WIN32_WCE)\r
@@ -377,7 +401,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             fgSetWindow( current_window );\r
         }\r
 \r
-        ReleaseDC( window->Window.Handle, window->Window.Device );\r
+        ReleaseDC( window->Window.Handle, window->Window.pContext.Device );\r
 \r
 #if defined(_WIN32_WCE)\r
         /* Take over button handling */\r