X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffreeglut_main_mswin.c;h=be48b23dec7769879c2a59156ff258cd25d50b59;hb=7662d246c2686f027ab71cbe4eb9d7310a236583;hp=b4d1bc9c4479a4c20c1aa5ca64fd55db8ec373dc;hpb=625d4f9446481f4a1684314cb559df7976090578;p=freeglut diff --git a/src/mswin/freeglut_main_mswin.c b/src/mswin/freeglut_main_mswin.c index b4d1bc9..be48b23 100644 --- a/src/mswin/freeglut_main_mswin.c +++ b/src/mswin/freeglut_main_mswin.c @@ -108,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 ); @@ -329,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; @@ -340,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 @@ -348,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 { @@ -362,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) @@ -391,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 */