From fae5ec0c3adab348943cb917fe8fbc79bc2069a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 31 Mar 2023 13:03:06 -0300 Subject: [PATCH] ecode: Disable vsync by default. --- include/eepp/window/engine.hpp | 3 ++- src/eepp/window/engine.cpp | 5 +++-- src/tools/ecode/ecode.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index b82ba52b5..f661fb26d 100644 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -109,7 +109,8 @@ class EE_API Engine { @param ini The ini file instance @param iniKeyName The ini key name to search the properties */ - ContextSettings createContextSettings( IniFile* ini, std::string iniKeyName = "EEPP" ); + ContextSettings createContextSettings( IniFile* ini, std::string iniKeyName = "EEPP", + bool vsyncEnabledByDefault = true ); /** Enabling Shared GL Context allows asynchronous OpenGL resource loading ( only if is *supported by the backend and the OS, SDL 2 backend is the only one supported ). * If the diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index e75bf4a7a..270b0f830 100644 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -319,12 +319,13 @@ WindowSettings Engine::createWindowSettings( std::string iniPath, std::string in return createWindowSettings( &Ini, iniKeyName ); } -ContextSettings Engine::createContextSettings( IniFile* ini, std::string iniKeyName ) { +ContextSettings Engine::createContextSettings( IniFile* ini, std::string iniKeyName, + bool vsyncEnabledByDefault ) { eeASSERT( NULL != ini ); ini->readFile(); - bool VSync = ini->getValueB( iniKeyName, "vsync", true ); + bool VSync = ini->getValueB( iniKeyName, "vsync", vsyncEnabledByDefault ); std::string GLVersion = ini->getValue( iniKeyName, "glversion", "0" ); int depthBufferSize = ini->getValueI( iniKeyName, "depthbuffersize", 24 ); int stencilBufferSize = ini->getValueI( iniKeyName, "stencilbuffersize", 1 ); diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index c5e48214f..38ec809f8 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -2900,7 +2900,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe winSettings.Icon = mResPath + winSettings.Icon; } - mConfig.context = engine->createContextSettings( &mConfig.ini, "window" ); + mConfig.context = engine->createContextSettings( &mConfig.ini, "window", false ); mConfig.context.SharedGLContext = true; mWindow = engine->createWindow( winSettings, mConfig.context );