Skip to content

Instantly share code, notes, and snippets.

View Furkanzmc's full-sized avatar
🏣
Working from the office

Furkan Üzümcü Furkanzmc

🏣
Working from the office
View GitHub Profile
@Furkanzmc
Furkanzmc / VSyncForCocos2dX.cpp
Last active August 29, 2015 14:17 — forked from daltondotgd/VSyncForCocos2dX.cpp
To enable VSync for WIN32 in cocos2d-x, modify initWithRect(...) function in CCGLView.cpp, so it contains this code right before 'initGlew();'
...
...
...
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// Turn on vertical screen sync under Windows.
// (I.e. it uses the WGL_EXT_swap_control extension)
typedef BOOL(WINAPI *PFNWGLSWAPINTERVALEXTPROC)(int interval);
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");