mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-19 18:49:52 -06:00
Issue/525 (#593)
* Add initializeGL and deinitializeGL methods to OpenSpaceModule Call releaseAll from ProgramObjectManager in deinitializeGL to guard against errors when deinitializing assets * Change removeProgramObject function in RenderEngine to take a non-owning pointer instead of a reference to a unique pointer to make it compatible with the ProgramObjectManager Update Ghoul repository * Using ProgramObjectManager in more modules to reduce the number of programs compiled at startup
This commit is contained in:
@@ -57,6 +57,15 @@ void ModuleEngine::initialize(const ghoul::Dictionary& moduleConfigurations) {
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleEngine::initializeGL() {
|
||||
LDEBUG("Initializing OpenGL of modules");
|
||||
for (std::unique_ptr<OpenSpaceModule>& m : _modules) {
|
||||
LDEBUG(fmt::format("Initializing OpenGL of module '{}'", m->identifier()));
|
||||
m->initializeGL();
|
||||
}
|
||||
LDEBUG("Finished initializing OpenGL of modules");
|
||||
}
|
||||
|
||||
void ModuleEngine::deinitialize() {
|
||||
LDEBUG("Deinitializing modules");
|
||||
for (std::unique_ptr<OpenSpaceModule>& m : _modules) {
|
||||
@@ -64,6 +73,8 @@ void ModuleEngine::deinitialize() {
|
||||
m->deinitialize();
|
||||
}
|
||||
|
||||
LDEBUG("Finished deinitializing modules");
|
||||
|
||||
for (std::unique_ptr<OpenSpaceModule>& m : _modules) {
|
||||
LDEBUG(fmt::format("Destroying module '{}'", m->identifier()));
|
||||
m = nullptr;
|
||||
@@ -73,6 +84,16 @@ void ModuleEngine::deinitialize() {
|
||||
_modules.clear();
|
||||
}
|
||||
|
||||
void ModuleEngine::deinitializeGL() {
|
||||
LDEBUG("Deinitializing OpenGL of modules");
|
||||
for (std::unique_ptr<OpenSpaceModule>& m : _modules) {
|
||||
LDEBUG(fmt::format("Deinitializing OpenGL of module '{}'", m->identifier()));
|
||||
m->deinitializeGL();
|
||||
|
||||
}
|
||||
LDEBUG("Finished deinitializing OpenGL of modules");
|
||||
}
|
||||
|
||||
void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> m,
|
||||
const ghoul::Dictionary& configuration)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user