diff options
Diffstat (limited to 'src/app/app.h')
-rw-r--r-- | src/app/app.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/app/app.h b/src/app/app.h index 66b5848..84da0eb 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -113,6 +113,31 @@ enum MouseMode MOUSE_NONE, //! < no cursor visible }; +/** + * \enum PerformanceCounter + * \brief Type of counter testing performance + */ +enum PerformanceCounter +{ + PCNT_EVENT_PROCESSING, //! < event processing (except update events) + + PCNT_UPDATE_ALL, //! < the whole frame update process + PCNT_UPDATE_ENGINE, //! < frame update in CEngine + PCNT_UPDATE_PARTICLE, //! < frame update in CParticle + PCNT_UPDATE_GAME, //! < frame update in CRobotMain + + PCNT_RENDER_ALL, //! < the whole rendering process + PCNT_RENDER_PARTICLE, //! < rendering the particles in 3D + PCNT_RENDER_WATER, //! < rendering the water + PCNT_RENDER_TERRAIN, //! < rendering the terrain + PCNT_RENDER_OBJECTS, //! < rendering the 3D objects + PCNT_RENDER_INTERFACE, //! < rendering 2D interface + + PCNT_ALL, //! < all counters together + + PCNT_MAX +}; + struct ApplicationPrivate; /** @@ -301,6 +326,13 @@ public: bool GetLowCPU(); //@} + //! Management of performance counters + //@{ + void StartPerformanceCounter(PerformanceCounter counter); + void StopPerformanceCounter(PerformanceCounter counter); + float GetPerformanceCounterData(PerformanceCounter counter); + //@} + protected: //! Creates the window's SDL_Surface bool CreateVideoSurface(); @@ -321,6 +353,11 @@ protected: //! Closes the joystick device void CloseJoystick(); + //! Resets all performance counters to zero + void ResetPerformanceCounters(); + //! Updates performance counters from gathered timer data + void UpdatePerformanceCountersData(); + protected: //! Instance manager CInstanceManager* m_iMan; @@ -363,6 +400,9 @@ protected: SystemTimeStamp* m_lastTimeStamp; SystemTimeStamp* m_curTimeStamp; + SystemTimeStamp* m_performanceCounters[PCNT_MAX][2]; + float m_performanceCountersData[PCNT_MAX]; + long long m_realAbsTimeBase; long long m_realAbsTime; long long m_realRelTime; |