PDA

View Full Version : Vsync... disable it with code?



Mitchell Hayenga
02-17-2001, 08:26 PM
Hey, I always remember seeing in my videocard setting that you can have vsync "on by default"... well, how do I change it off, since there is a default, it *should* be able to be changed...
I'm using glut to do my window managing(looked through the docs to see if it had a function, didnt have much luck) and I'm working under win2k(although I'd like a platform independent solution)...
Thanks

Teofuzz
02-18-2001, 12:19 AM
You'll have to check if there is this extension: WGL_EXT_swap_control
However I think that every opengl32.dll has this, but thisi is very platform dependant!
This is the code where I disable vsync...
'message' is a function that writes in a file for debug, you can remove it.

wglSwapIntervalEXT=( BOOL (APIENTRY*)(int) )wglGetProcAddress("wglSwapIntervalEXT");
if (wglSwapIntervalEXT!=NULL) {
message("Vsync disabled (wglSwapIntervalEXT)\n");
wglSwapIntervalEXT(0);
}
else {
message("Vsync unchanged (wglSwapIntervalEXT not found)\n");
}

Mitchell Hayenga
02-18-2001, 02:25 PM
thanks..