Skip to content

Commit

Permalink
Enable vsync by default (axmolengine#2118)
Browse files Browse the repository at this point in the history
* Enable vsync by default

* Update comment

* Update comment [skip ci]
  • Loading branch information
halx99 authored and xfbird committed Sep 18, 2024
1 parent f3f4c76 commit 822fa51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/platform/GLView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions templates/cpp/Source/AppDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/lua/Source/AppDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 822fa51

Please sign in to comment.