| 2245 | } |
| 2246 | |
| 2247 | void Step(HEngine engine) |
| 2248 | { |
| 2249 | engine->m_Alive = true; |
| 2250 | engine->m_RunResult.m_ExitCode = 0; |
| 2251 | engine->m_RunResult.m_Action = dmEngine::RunResult::NONE; |
| 2252 | |
| 2253 | float step_dt; // The dt for each step (the game frame) |
| 2254 | uint32_t num_steps; // Number of times to loop over the StepFrame function |
| 2255 | |
| 2256 | CalcTimeStep(engine, step_dt, num_steps); |
| 2257 | |
| 2258 | for (uint32_t i = 0; i < num_steps; ++i) |
| 2259 | { |
| 2260 | DM_PROFILE("Step"); |
| 2261 | // We currently cannot separate the update from the render, |
| 2262 | // since some of the update is done in the render updates (e.g. sprite transforms) |
| 2263 | StepFrame(engine, step_dt); |
| 2264 | |
| 2265 | if (!engine->m_Alive) |
| 2266 | break; |
| 2267 | } |
| 2268 | |
| 2269 | } |
| 2270 | |
| 2271 | static int IsRunning(void* context) |
| 2272 | { |