ecode: Disable vsync by default.

This commit is contained in:
Martín Lucas Golini
2023-03-31 13:03:06 -03:00
parent 1b709fc02c
commit fae5ec0c3a
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -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
+3 -2
View File
@@ -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 );
+1 -1
View File
@@ -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 );