renderer: re-use the same opengl instance for all background rendering
Previously the OpenGL instance was tied to each render/cache task, creating and destroying it each time one started and stopped. This was completely unnecessary since the instance holds no state and can be shared by all of the render tasks without having to expensively start a new one.
This commit is contained in:
+7
-3
@@ -181,6 +181,9 @@ void Core::Start()
|
||||
// the fact that some of the config paths set by default rely on the app name having been set (in main())
|
||||
Config::Current().SetDefaults();
|
||||
|
||||
// Load application config
|
||||
Config::Load();
|
||||
|
||||
// Declare custom types for Qt signal/slot system
|
||||
DeclareTypesForQt();
|
||||
|
||||
@@ -193,9 +196,8 @@ void Core::Start()
|
||||
// Initialize task manager
|
||||
TaskManager::CreateInstance();
|
||||
|
||||
// Load application config
|
||||
Config::Load();
|
||||
|
||||
// Initialize OpenGL service
|
||||
OpenGLProxy::CreateInstance();
|
||||
|
||||
//
|
||||
// Start application
|
||||
@@ -223,6 +225,8 @@ void Core::Stop()
|
||||
}
|
||||
}
|
||||
|
||||
OpenGLProxy::DestroyInstance();
|
||||
|
||||
MenuShared::DestroyInstance();
|
||||
|
||||
TaskManager::DestroyInstance();
|
||||
|
||||
Reference in New Issue
Block a user