X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2FCommon%2Ffreeglut_main.c;h=b3bd7eeac13a746f0fb9a70c2e5c46f51ab951d1;hb=01660d2c066d083d088dfe6117a7688ee4521527;hp=980159def4327e33ab674f483facf2ed25ff483e;hpb=83a7f1444d1388983a7b756dde26b0cc74101b13;p=freeglut diff --git a/src/Common/freeglut_main.c b/src/Common/freeglut_main.c index 980159d..b3bd7ee 100644 --- a/src/Common/freeglut_main.c +++ b/src/Common/freeglut_main.c @@ -72,6 +72,7 @@ struct GXKeyList gxKeyList; extern void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height ); extern void fgPlatformDisplayWindow ( SFG_Window *window ); +extern unsigned long fgPlatformSystemTime ( void ); extern void fgPlatformSleepForEvents( long msec ); extern void fgPlatformProcessSingleEvent ( void ); extern void fgPlatformMainLoopPreliminaryWork ( void ); @@ -174,6 +175,16 @@ void fgPlatformDisplayWindow ( SFG_Window *window ) { fghRedrawWindow ( window ) ; } + + +unsigned long fgPlatformSystemTime ( void ) +{ +#if TARGET_HOST_SOLARIS || HAVE_GETTIMEOFDAY + struct timeval now; + gettimeofday( &now, NULL ); + return now.tv_usec/1000 + now.tv_sec*1000; +#endif +} #endif static void fghcbDisplayWindow( SFG_Window *window, @@ -262,18 +273,9 @@ static void fghCheckTimers( void ) * when subtracting an initial start time, unless the total time exceeds * 32-bit, where the GLUT API return value is also overflowed. */ -unsigned long fgSystemTime(void) { -#if TARGET_HOST_SOLARIS || HAVE_GETTIMEOFDAY - struct timeval now; - gettimeofday( &now, NULL ); - return now.tv_usec/1000 + now.tv_sec*1000; -#elif TARGET_HOST_MS_WINDOWS -# if defined(_WIN32_WCE) - return GetTickCount(); -# else - return timeGetTime(); -# endif -#endif +unsigned long fgSystemTime(void) +{ + return fgPlatformSystemTime (); } /*