From 819c7120063546629d0db2a82a33ec5c9a52158c Mon Sep 17 00:00:00 2001 From: fayjf 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: https://svn.code.sf.net/p/freeglut/code/trunk@585 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/freeglut_init.c b/freeglut/freeglut/src/freeglut_init.c index 9cc6a72..89e4c43 100644 --- a/freeglut/freeglut/src/freeglut_init.c +++ b/freeglut/freeglut/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;