Sdk/Application: Add GetUpdateTime()
Former-commit-id: 55acb0529b41860c56ad0717ab15005e4d237f0f
This commit is contained in:
parent
8732cc9459
commit
2736081578
|
|
@ -20,6 +20,7 @@ namespace Ndk
|
|||
public:
|
||||
inline Application();
|
||||
Application(const Application&) = delete;
|
||||
Application(Application&&) = delete;
|
||||
inline ~Application();
|
||||
|
||||
#ifndef NDK_SERVER
|
||||
|
|
@ -27,11 +28,14 @@ namespace Ndk
|
|||
#endif
|
||||
template<typename... Args> World& AddWorld(Args&&... args);
|
||||
|
||||
inline float GetUpdateTime() const;
|
||||
|
||||
bool Run();
|
||||
|
||||
inline void Quit();
|
||||
|
||||
Application& operator=(const Application&) = delete;
|
||||
Application& operator=(Application&&) = delete;
|
||||
|
||||
inline static Application* Instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ namespace Ndk
|
|||
return m_worlds.back();
|
||||
}
|
||||
|
||||
inline float Application::GetUpdateTime() const
|
||||
{
|
||||
return m_updateTime;
|
||||
}
|
||||
|
||||
inline void Application::Quit()
|
||||
{
|
||||
m_shouldQuit = true;
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ namespace Ndk
|
|||
}
|
||||
#endif
|
||||
|
||||
float elapsedTime = m_updateClock.GetSeconds();
|
||||
m_updateTime = m_updateClock.GetSeconds();
|
||||
m_updateClock.Restart();
|
||||
|
||||
for (World& world : m_worlds)
|
||||
world.Update(elapsedTime);
|
||||
world.Update(m_updateTime);
|
||||
|
||||
if (m_shouldQuit)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue