Jump to content
  • Advertisement
Sign in to follow this  
phantom_of_the_opera

OpenGL Refresh rate manipulation

This topic is 4610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I dont know the function that does it but it is Vsinc that does it.

Share this post


Link to post
Share on other sites
You should have something like this somewhere in the window creation:

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!