Explorar o código

"float Time::GetFramesPerSecond() const" API

Rokas Kupstys %!s(int64=8) %!d(string=hai) anos
pai
achega
fe1a20025f
Modificáronse 2 ficheiros con 8 adicións e 0 borrados
  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.