refactoring scene rendering

This commit is contained in:
antopilo
2021-09-20 06:49:45 -04:00
parent 519d9165e1
commit 4d1e134eaa
44 changed files with 604 additions and 826 deletions

View File

@@ -48,26 +48,22 @@ namespace Nuake
m_LastFrameTime = m_Time;
// Dont update if no scene is loaded.
if (CurrentWindow->GetScene())
{
if (CurrentWindow->GetScene()) {
CurrentWindow->Update(timestep);
// Play mode update all the entities, Editor does not.
if (Engine::IsPlayMode)
{
if (Engine::IsPlayMode) {
m_FixedUpdateDifference += timestep;
// Fixed update
if (m_FixedUpdateDifference >= m_FixedUpdateRate)
{
CurrentWindow->FixedUpdate(m_FixedUpdateRate);
m_FixedUpdateDifference = 0.f;
if (m_FixedUpdateDifference >= m_FixedUpdateRate) {
CurrentWindow->FixedUpdate(m_FixedUpdateDifference);
m_FixedUpdateDifference -= m_FixedUpdateRate;
}
}
else
{
GetCurrentScene()->EditorUpdate(timestep);
}
}
Input::Update();