refresh rates

Started by
10 comments, last by hello_there 20 years, 6 months ago
how do you change the refresh rate of the monitor? using opengl.
____________________________________________________________How could hell be worse?
Advertisement
BAD idea
You cant do that from opengl, you must do it via os specific calls
You choose the refresh rate when requesting fullscreen mode.

How appropriate. You fight like a cow.

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.

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
You never have an app set the refresh rate. The most you do is turn off vsync. Otherwise you''ll be paying for people''s monitors you end up frying.

Ben


[ IcarusIndie.com | recycledrussianbrides.com | Got Linux? ]


Will Post For Food
EXT_swap_control == Turn off VSYNC == let it run as fast as it can == GOOD

You really don''t want TO lock the framerate...
Locked framerates == LAWSUITS !
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]
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?

This topic is closed to new replies.

Advertisement