PDA

View Full Version : detecting a refresh rate in opengl



hades
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.

zed
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

hades
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.

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

gav

zed
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

Lucretia
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.

Luke.

Bob
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.