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