X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffreeglut_main_mswin.c;h=be48b23dec7769879c2a59156ff258cd25d50b59;hb=7662d246c2686f027ab71cbe4eb9d7310a236583;hp=96ec77b0b7913be0a267381639f39118ea6c8bb2;hpb=b7ffd3e60d961de87355b3027e589eb150337e60;p=freeglut diff --git a/src/mswin/freeglut_main_mswin.c b/src/mswin/freeglut_main_mswin.c index 96ec77b..be48b23 100644 --- a/src/mswin/freeglut_main_mswin.c +++ b/src/mswin/freeglut_main_mswin.c @@ -26,7 +26,7 @@ */ #include -#include "freeglut_internal_mswin.h" +#include "../Common/freeglut_internal.h" extern void fghRedrawWindow ( SFG_Window *window ); @@ -35,6 +35,20 @@ extern void fgNewWGLCreateContext( SFG_Window* window ); extern GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, unsigned char layer_type ); +#ifdef WM_TOUCH +typedef BOOL (WINAPI *pGetTouchInputInfo)(HTOUCHINPUT,UINT,PTOUCHINPUT,int); +typedef BOOL (WINAPI *pCloseTouchInputHandle)(HTOUCHINPUT); +static pGetTouchInputInfo fghGetTouchInputInfo = (pGetTouchInputInfo)0xDEADBEEF; +static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF; +#endif + +/* + * Helper functions for getting client area from the window rect + * and the window rect from the client area given the style of the window + * (or a valid window pointer from which the style can be queried). + */ +extern void fghComputeWindowRectFromClientArea_QueryWindow( const SFG_Window *window, RECT *clientRect, BOOL posIsOutside ); +extern RECT fghGetClientArea ( const SFG_Window *window, BOOL wantPosOutside ); void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height ) @@ -94,6 +108,16 @@ void fgPlatformDisplayWindow ( SFG_Window *window ) } +unsigned long fgPlatformSystemTime ( void ) +{ +#if defined(_WIN32_WCE) + return GetTickCount(); +#else + return timeGetTime(); +#endif +} + + void fgPlatformSleepForEvents( long msec ) { MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLINPUT ); @@ -315,7 +339,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, "fgPlatformWindowProc" ); window->Window.Handle = hWnd; - window->Window.Device = GetDC( hWnd ); + window->Window.pContext.Device = GetDC( hWnd ); if( window->IsMenu ) { unsigned int current_DisplayMode = fgState.DisplayMode; @@ -326,7 +350,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, fgState.DisplayMode = current_DisplayMode; if( fgStructure.MenuContext ) - wglMakeCurrent( window->Window.Device, + wglMakeCurrent( window->Window.pContext.Device, fgStructure.MenuContext->MContext ); else @@ -334,11 +358,11 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, fgStructure.MenuContext = (SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) ); fgStructure.MenuContext->MContext = - wglCreateContext( window->Window.Device ); + wglCreateContext( window->Window.pContext.Device ); } /* window->Window.Context = wglGetCurrentContext (); */ - window->Window.Context = wglCreateContext( window->Window.Device ); + window->Window.Context = wglCreateContext( window->Window.pContext.Device ); } else { @@ -348,13 +372,13 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, if( ! fgState.UseCurrentContext ) window->Window.Context = - wglCreateContext( window->Window.Device ); + wglCreateContext( window->Window.pContext.Device ); else { window->Window.Context = wglGetCurrentContext( ); if( ! window->Window.Context ) window->Window.Context = - wglCreateContext( window->Window.Device ); + wglCreateContext( window->Window.pContext.Device ); } #if !defined(_WIN32_WCE) @@ -377,7 +401,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, fgSetWindow( current_window ); } - ReleaseDC( window->Window.Handle, window->Window.Device ); + ReleaseDC( window->Window.Handle, window->Window.pContext.Device ); #if defined(_WIN32_WCE) /* Take over button handling */