| 132 | } |
| 133 | |
| 134 | void GameBase::BeforeRun() |
| 135 | { |
| 136 | // Headless more case (no window) |
| 137 | if (Engine::IsHeadless()) |
| 138 | { |
| 139 | GameBaseImpl::OnSplashScreenEnd(); |
| 140 | return; |
| 141 | } |
| 142 | |
| 143 | // Show game window |
| 144 | LOG(Info, "Showing game window"); |
| 145 | ASSERT(Engine::MainWindow); |
| 146 | Engine::MainWindow->Show(); |
| 147 | |
| 148 | // Show splash screen if it should be used |
| 149 | if (GameBaseImpl::SplashScreen && GPUDevice::Instance && GPUDevice::Instance->GetRendererType() != RendererType::Null) |
| 150 | { |
| 151 | LOG(Info, "Showing splash screen"); |
| 152 | if (MainRenderTask::Instance == nullptr) |
| 153 | Platform::Fatal(TEXT("Missing main rendering task object.")); |
| 154 | GameBaseImpl::SplashScreenTime = 0; |
| 155 | MainRenderTask::Instance->PostRender.Bind(&GameBaseImpl::OnPostRender); |
| 156 | } |
| 157 | else |
| 158 | { |
| 159 | GameBaseImpl::OnSplashScreenEnd(); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void GameBase::BeforeExit() |
| 164 | { |