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:
itsmattkc
2020-06-19 17:06:14 +10:00
parent ab74c1579e
commit b2a3cede2c
7 changed files with 52 additions and 41 deletions
+7 -3
View File
@@ -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();