Skip to main content
GameDev.net gamedev.net
🔒 Locked

refresh rates

Started by hello_there Oct 9, 2003 at 11:38 PM 10 replies 1.8k views
Original Post
hello_there
hello_there
how do you change the refresh rate of the monitor? using opengl.
____________How could hell be worse?
MARS_999
MARS_999
BAD idea
MazyNoc
MazyNoc
You cant do that from opengl, you must do it via os specific calls
Sneftel
Sneftel
You choose the refresh rate when requesting fullscreen mode.


How appropriate. You fight like a cow.
Kambiz
Kambiz

LONG ChangeDisplaySettings(
LPDEVMODE lpDevMode, // graphics mode
DWORD dwflags // graphics mode options
);

typedef struct _devicemode {
...
DWORD dmDisplayFrequency;
...
} DEVMODE;

dmDisplayFrequency:
Specifies the frequency, in hertz (cycles per second), of the display device in a particular mode. This value is also known as the display device''s vertical refresh rate. Display drivers use this member. It is used, for example, in the ChangeDisplaySettings function. Printer drivers do not use this member.
When you call the EnumDisplaySettings function, the dmDisplayFrequency member may return with the value 0 or 1. These values represent the display hardware''s default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by a configuration program that does not use display functions such as ChangeDisplaySettings.

_the_phantom_
_the_phantom_
and remember to set the correct bit in the dwflags option to enable the change in refresh rates as most code i''ve seen (inc. NeHe''s base code) doesnt set this bit
_the_phantom_
_the_phantom_
You can have the app set the refresh rate, just ask the OS what refresh rates the monitor can do, at worse you'll get standard 60hz across the board if the user doesnt have the correct driver or fiddled their setup. Also all monitors i've come across since 1998 turn themselves off when windows asks 'em to do a refresh rate they cant handle to prevent damage. Infact, the only monitor i've had which didnt support that feature was a 14inch one from 1996!

Vsync off != GOOD!!!
The ONLY good reason to force vsync off is profiling, by all means give a user the option to turn it off if they want, however with it off you get tearing off the image and an overall degregation of experiance.

And how on earth did you work out that locked framerates = lawsuits???

[edited by - _the_phantom_ on October 10, 2003 5:18:38 PM]
hello_there
hello_there
i never said anything about locking the frame rate. it's just i want to be able to change the refresh rate cause me monitor it on 75 on the desktop and it changes tp 60 when i load my programe and it's annoying me cause i have to change the channel on my monitor because the screen goes funny otherwise.

[edited by - hello_there on October 10, 2003 9:15:28 PM]
____________How could hell be worse?
hello_there
hello_there
also isn''t it good to turn Vsync on because if you get a to high frame rate it can start going a bit jumpy. because it happens in my programe. but with Vsync on it doesn''t.
____________How could hell be worse?
_the_phantom_
_the_phantom_
errm, any chance you could clear up which of those ''on''s should be an ''off'' ?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.