How to get refresh rate of the monitor?

Question is above…

How about getDisplayDuration at

http://msdn.microsoft.com/library/defaul…7122510.xml.asp

Originally posted by Sam Kovalev:
Question is above…

Question is: what do you need it for?

If you want to know it in your program so you can do something with it, I’d say you need to call an OS function to get that information.
Not that I know which function that would be but there’s bound to be one. But for somebody to put you on the right track, you’ll need to tell the people here what OS you’re using. Windows? Linux? Something else?

Mind you, it doesn’t sound like a good idea to me to make your program refresh rate dependent.
Generally, you’ll want to compensate for the frame rate instead.
If you’re interested in the frame rate, that’s a whole different question.

No i need a refresh rate of the monitor just to create some kind of options inside my application. So i can give a user a choise of the resolution params, but if i want to enter a GameMode i need to write the refresh rate too,so in that case i need this information.
p.s.
refresh rate of the LCD and TFT really differs thats why it can be a static number.

Then I suppose you’re more interested in what refresh rates are available at which resolutions.

Either way, if you’re writing for Windows (you still haven’t told us), have a look at MSDN:
http://msdn.microsoft.com/archive/defaul…daptermodes.asp

That seems to give you all the information you need: resolution, pixel format and refresh rate.

Look up DEVMODE at MSDN, there you’ll find functions to set and get refresh rate under windows.
You should remember that if there is no monitor inf file in system you can set refresh up to 200 for ex. and possibly smoke something…

Yes, i am creating a windows application using OpenGL. Can i just use this function you linked, or should add to project some library files of DirectX. Are where any OpenGL analogs?