🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

enable vsync in opengl

Started by
2 comments, last by mudlouse 17 years, 5 months ago
Hi, I was looking at this thread but it's been retired. http://www.gamedev.net/community/forums/topic.asp?topic_id=417071&whichpage=1? I wanted to ask how I use the code? Thanks
Advertisement
Retired? I can open that page just fine. All the code is there.


void InitVSync()
{
char* extensions = (char*)glGetString(GL_EXTENSIONS);
if (strstr(extensions,"WGL_EXT_swap_control"))
{
wglSwapIntervalEXT = (PFNWGLEXTSWAPCONTROLPROC)
wglGetProcAddress("wglSwapIntervalEXT");
wglGetSwapIntervalEXT = (PFNWGLEXTGETSWAPINTERVALPROC)
wglGetProcAddress("wglGetSwapIntervalEXT");
}
}
void SetVSync(bool VSync)
{
wglSwapIntervalEXT(VSync ? 1 : 0);
}
bool GetVSync()
{
return wglGetSwapIntervalEXT()==0 ? false : true;
}
i can see the thread, just not reply to it.

i'm able to get up a window using glut, i just don't know how to implement the code. do i also need to deal with extensions?
don't worry about it, i'm going to try and implement another work around to the problem.

i was trying to effectively limit the fps so this seems more appropriate:

http://www.gamedev.net/community/forums/topic.asp?topic_id=430433&whichpage=1&#2862292

This topic is closed to new replies.

Advertisement