X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffreeglut_main_mswin.c;h=be48b23dec7769879c2a59156ff258cd25d50b59;hb=0cd6817079c9f545bbff65d6ac86d9fac6b92db9;hp=e233ecfd8cabbb6e8020a1d51781568c75372a73;hpb=3eed8855ebe5e559e37503f99a76b009def7a3f7;p=freeglut diff --git a/src/mswin/freeglut_main_mswin.c b/src/mswin/freeglut_main_mswin.c index e233ecf..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 ); @@ -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 */