Refresh rate manipulation

Started by
4 comments, last by phantom_of_the_opera 18 years ago
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
Advertisement
I dont know the function that does it but it is Vsinc that does it.
For Windows, wglSwapInterval, prehaps?

I don't know how Linux handles control of Vsync, though.
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.
error C2065: 'signature' : undeclared identifier
I'll give it a try. Thanks.
It works! Thank you very much.

This topic is closed to new replies.

Advertisement