فهرست منبع

"float Time::GetFramesPerSecond() const" API

Rokas Kupstys 8 سال پیش
والد
کامیت
fe1a20025f
2فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 5 0
      Source/Urho3D/Core/Timer.cpp
  2. 3 0
      Source/Urho3D/Core/Timer.h

+ 5 - 0
Source/Urho3D/Core/Timer.cpp

@@ -189,6 +189,11 @@ void Time::Sleep(unsigned mSec)
 #endif
 }
 
+float Time::GetFramesPerSecond() const
+{
+    return 1.0f / timeStep_;
+}
+
 Timer::Timer()
 {
     Reset();

+ 3 - 0
Source/Urho3D/Core/Timer.h

@@ -104,6 +104,9 @@ public:
     /// Return elapsed time from program start as seconds.
     float GetElapsedTime();
 
+    /// Return current frames per second.
+    float GetFramesPerSecond() const;
+
     /// Get system time as milliseconds.
     static unsigned GetSystemTime();
     /// Get system time as seconds since 1.1.1970.