Enable vsync by default (#2118)

* Enable vsync by default

* Update comment

* Update comment [skip ci]
This commit is contained in:
halx99 2024-08-30 09:14:22 +08:00 committed by GitHub
parent 80f55eb87a
commit 62393b9271
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -88,7 +88,7 @@ struct GLContextAttrs
int multisamplingCount;
bool visible = true;
bool decorated = true;
bool vsync = false;
bool vsync = true;
#if defined(_WIN32)
void* viewParent = nullptr;
#endif

View File

@ -46,6 +46,8 @@ void AppDelegate::initGLContextAttrs()
{
// set OpenGL context attributes: red,green,blue,alpha,depth,stencil,multisamplesCount
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8, 0};
// since axmol-2.2 vsync was enabled in engine by default
// glContextAttrs.vsync = false;
GLView::setGLContextAttrs(glContextAttrs);
}

View File

@ -46,7 +46,7 @@ void AppDelegate::initGLContextAttrs()
{
// set OpenGL context attributes: red,green,blue,alpha,depth,stencil,multisamplesCount
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8, 0};
// glContextAttrs.vsync = false
GLView::setGLContextAttrs(glContextAttrs);
}