PDA

View Full Version : How to get refresh rate of the monitor?



Sam Kovalev
04-04-2005, 07:21 PM
Question is above...

zero_t9
04-04-2005, 10:19 PM
How about getDisplayDuration at

http://msdn.microsoft.com/library/defaul...7122510.xml.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/graphics/hh/graphics/ddfncs_abecf7f3-74d6-4ee7-8ca7-2c1317122510.xml.asp)


Originally posted by Sam Kovalev:
Question is above...

T101
04-04-2005, 10:24 PM
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.

Sam Kovalev
04-07-2005, 07:51 AM
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.

T101
04-07-2005, 08:05 AM
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 (http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_c/directx_cpp/Graphics/reference/CPP/D3D/Interfaces/IDirect3D8/enumadaptermodes.asp)

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

M/\dm/\n
04-10-2005, 11:13 AM
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...

Sam Kovalev
04-12-2005, 06:54 PM
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?