If the computer supports the WGL_EXT_swap_control extension then you can use the wglSwapIntervalEXT function with an argument of 0.
Here you go a code that you can use:
and then just call the function when you initalize opengl:
void setVSync(int interval=1){ const char *extensions =(const char *)glGetString( GL_EXTENSIONS ); if( strstr( extensions, "WGL_EXT_swap_control" ) == 0 ) return; // Error: WGL_EXT_swap_control extension not supported on your computer.\n"); else { wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" ); if( wglSwapIntervalEXT ) wglSwapIntervalEXT(interval); }}
and then just call the function when you initalize opengl:
// calling Vsync setVSync(1);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement