Refresh rate manipulation
Hello,
first of all, sorry if it has been already discussed but I haven't found it yet.
So I'd like to know how to change the refresh rate in OpenGL (both Linux & Windows).
Thanks in advance
the phantom of the Opera
You should have something like this somewhere in the window creation:
You should set the dmDisplayFrequency field of the DEVMODE structure and add DM_DISPLAYFREQUENCY to it's flags, like this:
Hope that works.
DEVMODE dmScreenSettings; memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = Width; dmScreenSettings.dmPelsHeight = Height; dmScreenSettings.dmBitsPerPel = Bits; dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
You should set the dmDisplayFrequency field of the DEVMODE structure and add DM_DISPLAYFREQUENCY to it's flags, like this:
DEVMODE dmScreenSettings; memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = Width; dmScreenSettings.dmPelsHeight = Height; dmScreenSettings.dmBitsPerPel = Bits; dmScreenSettings.dmDisplayFrequency = Frequency; dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
Hope that works.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement