X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmswin%2Ffreeglut_main_mswin.c;h=8a13a8415bb490da360372ff6550d14809cab32c;hb=1ede9f68f98e29ddd07bd466310967e716bfac92;hp=290f1615f22d0f6d7ff1d346c8c02521d6efd78f;hpb=76169d74298feb3c4976af3f0f10376f56aec38d;p=freeglut diff --git a/src/mswin/freeglut_main_mswin.c b/src/mswin/freeglut_main_mswin.c index 290f161..8a13a84 100644 --- a/src/mswin/freeglut_main_mswin.c +++ b/src/mswin/freeglut_main_mswin.c @@ -42,6 +42,20 @@ static pGetTouchInputInfo fghGetTouchInputInfo = (pGetTouchInputInfo)0xDEADBEEF; static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF; #endif +#ifdef _WIN32_WCE +typedef struct GXDisplayProperties GXDisplayProperties; +typedef struct GXKeyList GXKeyList; +#include + +typedef struct GXKeyList (*GXGETDEFAULTKEYS)(int); +typedef int (*GXOPENINPUT)(); + +GXGETDEFAULTKEYS GXGetDefaultKeys_ = NULL; +GXOPENINPUT GXOpenInput_ = NULL; + +struct GXKeyList gxKeyList; +#endif /* _WIN32_WCE */ + /* * Helper functions for getting client area from the window rect * and the window rect from the client area given the style of the window @@ -108,17 +122,25 @@ void fgPlatformDisplayWindow ( SFG_Window *window ) } -unsigned long fgPlatformSystemTime ( void ) +fg_time_t fgPlatformSystemTime ( void ) { #if defined(_WIN32_WCE) return GetTickCount(); #else + /* TODO: do this with QueryPerformanceCounter as timeGetTime has + * insufficient resolution (only about 5 ms on system under low load). + * See: + * http://msdn.microsoft.com/en-us/library/windows/desktop/dd757629(v=vs.85).aspx + * Or maybe QueryPerformanceCounter is not a good idea either, see + * http://old.nabble.com/Re%3A-glutTimerFunc-does-not-detect-if-system-time-moved-backward-p33479674.html + * for some other ideas (at bottom)... + */ return timeGetTime(); #endif } -void fgPlatformSleepForEvents( long msec ) +void fgPlatformSleepForEvents( fg_time_t msec ) { MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLINPUT ); }