Add possibility to check if OsEng is instantiated

This commit is contained in:
Emil Axelsson
2017-06-01 14:09:06 +02:00
parent f231ca290e
commit 5c67189c8d
3 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,15 @@ OnScreenGUIModule::OnScreenGUIModule()
{
addPropertySubOwner(gui);
// TODO: Remove dependency on OsEng.
// Instead, make this class implement an interface that OsEng depends on.
// Do not try to register module callbacks if OsEng does not exist,
// for example in the TaskRunner.
if (!OpenSpaceEngine::isCreated()) {
return;
}
OsEng.registerModuleCallback(
OpenSpaceEngine::CallbackOption::Initialize,
[](){