| 234 | } |
| 235 | |
| 236 | bool AppBase::Render() |
| 237 | { |
| 238 | META_FUNCTION_TASK(); |
| 239 | if (Platform::App::IsMinimized()) |
| 240 | { |
| 241 | // No need to render frames while window is minimized. |
| 242 | // Sleep thread for a while to not heat CPU by running the message loop |
| 243 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); // NOSONAR - false positive |
| 244 | return false; |
| 245 | } |
| 246 | |
| 247 | META_CHECK_TRUE_DESCR(m_context.IsInitialized(), "RenderContext is not initialized before rendering."); |
| 248 | if (!m_context.ReadyToRender()) |
| 249 | return false; |
| 250 | |
| 251 | META_LOG("\n========================= FRAME {} RENDERING =========================", m_context.GetFrameIndex()); |
| 252 | |
| 253 | // Wait for previous frame rendering is completed and switch to next frame |
| 254 | m_context.WaitForGpu(Rhi::IContext::WaitFor::FramePresented); |
| 255 | return true; |
| 256 | } |
| 257 | |
| 258 | bool AppBase::SetFullScreen(bool is_full_screen) |
| 259 | { |
nothing calls this directly
no test coverage detected