| 124 | } |
| 125 | |
| 126 | struct EngineModuleInit { |
| 127 | template<typename E> |
| 128 | static void InitializeEngineModule(E * instance, const bool log) { |
| 129 | if (log) { |
| 130 | STRATUS_LOG << "Initializing " << instance->Name() << std::endl; |
| 131 | } |
| 132 | |
| 133 | if (!instance->Initialize()) { |
| 134 | std::cerr << instance->Name() << " failed to load" << std::endl; |
| 135 | exit(-1); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | template<typename E> |
| 140 | static void InitializeEngineModule(E *& ptr, E * instance, const bool log) { |
| 141 | InitializeEngineModule<E>(instance, log); |
| 142 | ptr = instance; |
| 143 | } |
| 144 | }; |
| 145 | |
| 146 | void Engine::Initialize() { |
| 147 | // We need to initialize everything on renderer thread |
nothing calls this directly
no outgoing calls
no test coverage detected