| 328 | } |
| 329 | |
| 330 | ContextSettings Engine::createContextSettings( IniFile* ini, std::string iniKeyName, |
| 331 | bool vsyncEnabledByDefault ) { |
| 332 | eeASSERT( NULL != ini ); |
| 333 | |
| 334 | ini->readFile(); |
| 335 | |
| 336 | bool VSync = ini->getValueB( iniKeyName, "vsync", vsyncEnabledByDefault ); |
| 337 | std::string GLVersion = ini->getValue( iniKeyName, "glversion", "0" ); |
| 338 | int depthBufferSize = ini->getValueI( iniKeyName, "depthbuffersize", 24 ); |
| 339 | int stencilBufferSize = ini->getValueI( iniKeyName, "stencilbuffersize", 1 ); |
| 340 | int multisamples = ini->getValueI( iniKeyName, "multisamples", 0 ); |
| 341 | int frameRateLimit = ini->getValueI( iniKeyName, "frameratelimit", |
| 342 | ContextSettings::FrameRateLimitScreenRefreshRate ); |
| 343 | bool doubleBuffering = ini->getValueB( iniKeyName, "doublebuffering", true ); |
| 344 | bool sharedGLContext = ini->getValueB( iniKeyName, "sharedglcontext", false ); |
| 345 | |
| 346 | return ContextSettings( VSync, frameRateLimit, multisamples, |
| 347 | Renderer::glVersionFromString( GLVersion ), sharedGLContext, |
| 348 | doubleBuffering, depthBufferSize, stencilBufferSize ); |
| 349 | } |
| 350 | |
| 351 | ContextSettings Engine::createContextSettings( std::string iniPath, std::string iniKeyName ) { |
| 352 | IniFile Ini( iniPath ); |