projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing Bug Report [ 1160442 ] glutGet(GLUT_ELAPSED_TIME) is too granular
[freeglut]
/
src
/
freeglut_init.c
diff --git
a/src/freeglut_init.c
b/src/freeglut_init.c
index
9cc6a72
..
89e4c43
100644
(file)
--- a/
src/freeglut_init.c
+++ b/
src/freeglut_init.c
@@
-196,6
+196,9
@@
static void fghInitialize( const char* displayName )
ReleaseDC( desktop, context );
}
ReleaseDC( desktop, context );
}
+ /* Set the timer granularity to 1 ms */
+ timeBeginPeriod ( 1 );
+
#endif
fgState.Initialised = GL_TRUE;
#endif
fgState.Initialised = GL_TRUE;
@@
-289,7
+292,6
@@
void fgDeinitialize( void )
fgState.ProgramName = NULL;
}
fgState.ProgramName = NULL;
}
-
#if TARGET_HOST_UNIX_X11
/*
#if TARGET_HOST_UNIX_X11
/*
@@
-304,6
+306,11
@@
void fgDeinitialize( void )
*/
XCloseDisplay( fgDisplay.Display );
*/
XCloseDisplay( fgDisplay.Display );
+#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
+
+ /* Reset the timer granularity */
+ timeEndPeriod ( 1 );
+
#endif
fgState.Initialised = GL_FALSE;
#endif
fgState.Initialised = GL_FALSE;