PDA

View Full Version : Switching Vsync state



Soulreaver
03-09-2003, 04:09 AM
Finally i learnt to disable vsync.But when i disabled once in program i couldn't enable
it.Where is the problem?Here is my code to switch vsync state:

void Svsync(bool v)
{
if(!v)
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0;

wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
wglGetProcAddress("wglSwapIntervalEXT");
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)
wglGetProcAddress("wglGetSwapIntervalEXT");
tint=wglGetSwapIntervalEXT();
wglSwapIntervalEXT(0);

}

else
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0;

wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
wglGetProcAddress("wglSwapIntervalEXT");
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)
wglGetProcAddress("wglGetSwapIntervalEXT");
wglSwapIntervalEXT(1);

}
}

PM
03-11-2003, 06:56 AM
1. Post the code where you are using Svsync...
2. Are you sure you have disabled it? http://www.opengl.org/discussion_boards/ubb/wink.gif
3. Check if wglGetProcAddress retunrs NULL...
4. BTW why are you calling



tint=wglGetSwapIntervalEXT();

????
PM