| 66 | } |
| 67 | |
| 68 | bool PiccoloEngine::tickOneFrame(float delta_time) |
| 69 | { |
| 70 | logicalTick(delta_time); |
| 71 | calculateFPS(delta_time); |
| 72 | |
| 73 | // single thread |
| 74 | // exchange data between logic and render contexts |
| 75 | g_runtime_global_context.m_render_system->swapLogicRenderData(); |
| 76 | |
| 77 | rendererTick(delta_time); |
| 78 | |
| 79 | #ifdef ENABLE_PHYSICS_DEBUG_RENDERER |
| 80 | g_runtime_global_context.m_physics_manager->renderPhysicsWorld(delta_time); |
| 81 | #endif |
| 82 | |
| 83 | g_runtime_global_context.m_window_system->pollEvents(); |
| 84 | |
| 85 | |
| 86 | g_runtime_global_context.m_window_system->setTitle( |
| 87 | std::string("Piccolo - " + std::to_string(getFPS()) + " FPS").c_str()); |
| 88 | |
| 89 | const bool should_window_close = g_runtime_global_context.m_window_system->shouldClose(); |
| 90 | return !should_window_close; |
| 91 | } |
| 92 | |
| 93 | void PiccoloEngine::logicalTick(float delta_time) |
| 94 | { |
no test coverage detected