From 5288d8e11323c88acdec3af66ddf18c640c363a1 Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Wed, 27 Apr 2005 16:02:31 +0000 Subject: [PATCH] Fixing Bug Report [ 1160442 ] glutGet(GLUT_ELAPSED_TIME) is too granular git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@585 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 9cc6a72..89e4c43 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -196,6 +196,9 @@ static void fghInitialize( const char* displayName ) ReleaseDC( desktop, context ); } + /* Set the timer granularity to 1 ms */ + timeBeginPeriod ( 1 ); + #endif fgState.Initialised = GL_TRUE; @@ -289,7 +292,6 @@ void fgDeinitialize( void ) fgState.ProgramName = NULL; } - #if TARGET_HOST_UNIX_X11 /* @@ -304,6 +306,11 @@ void fgDeinitialize( void ) */ XCloseDisplay( fgDisplay.Display ); +#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE + + /* Reset the timer granularity */ + timeEndPeriod ( 1 ); + #endif fgState.Initialised = GL_FALSE; -- 1.7.10.4