/
redgpu
/
nv_rt
Обзор
Документация
Войти
/
redgpu
/
nv_rt
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
External/NRIFramework/Include/Timer.h
35 строк
657 B
Constantine Tarasenkov
NRDSample commit 3dd5136f292ad958c698627d2ee19959a4117f7e, NRI commit b5cfe2c4161ccc39421041ba9ec55331af9221d1
19 апр 2024, 05:54
19 апр 2024, 05:54
491b2d5
Код
Авторство
О чём код?
#pragma once #include <cstdint> class Timer { public: Timer(); void UpdateFrameTime(); // In milliseconds double GetTimeStamp() const; inline double GetLastFrameTimeStamp() const { return m_Time * m_InvTicksPerMs; } inline float GetFrameTime() const { return m_Delta; } inline float GetSmoothedFrameTime() const { return m_SmoothedDelta; } inline float GetVerySmoothedFrameTime() const { return m_VerySmoothedDelta; } private: private: uint64_t m_Time = 0; double m_InvTicksPerMs = 0.0; float m_Delta = 1.0f; float m_SmoothedDelta = 1.0f; float m_VerySmoothedDelta = 1.0f; };