To enable VSync for WIN32 in cocos2d-x, modify initWithRect(...) function in CCGLView.cpp, so it contains this code right before 'initGlew();'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
... | |
#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"); | |
if (wglSwapIntervalEXT) | |
wglSwapIntervalEXT(1); | |
#endif | |
initGlew(); // this already exists int the file | |
... | |
... | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment