View Full Version : detecting a refresh rate in opengl

09-02-2000, 11:09 AM
I am currently writing a program for a professor at Indiana University ( I am an undergraduate psychology major there). This program simply alternates between two white and black rectangles. However to make these ocellate correctly, I need to have the program find the monitor's refresh rate. Is there a way of doing this in either C or OpenGl? Thanks for your help.

09-02-2000, 02:25 PM
AFAIK this is OS specific information
glut has a command glutGameModeGet(GLUT_GAME_MODE_REFRESH_RATE) but i think this only works if youre in glut game mode to begin with

09-02-2000, 03:48 PM
Could you tell me either where I can get information on getting the refresh rate in windows or simply post it yourself (if you know)? Thanks.

09-03-2000, 11:57 PM
Have a look at the drawsprocket toolkit, pretty sure you can do it on that


09-04-2000, 01:29 AM
BOOL EnumDisplaySettings(
LPCTSTR lpszDeviceName, // display device
DWORD iModeNum, // graphics mode
LPDEVMODE lpDevMode // graphics mode settings
+ in lpDevMode theres a var called dmDisplayFrequency
have a look in windopws halp 4 a more detailed information

09-04-2000, 02:30 AM
Well, I have tried this and the refresh rate always is 0. In another example I saw it checked it and set it to 60 if it was 0.

I also did this.

This is another proiblem with the windows version of OpenGL.


09-04-2000, 05:28 AM
In what way is this an OpenGL problem?

The refresh rate is a problem for the functions dealing with setting displaymode, and that has nothing to do with OpenGL. OpenGL starts when the display/window is ready for rendering.