NvFramerateCounter.h
Go to the documentation of this file.00001 // TAGRELEASE: PUBLIC 00002 00003 /* Framerate stats */ 00004 00005 #ifndef NVFRAMERATECOUNTER_H 00006 #define NVFRAMERATECOUNTER_H 00007 00008 #include <NvFoundation.h> 00009 00012 00013 class NvAppBase; 00014 class NvStopWatch; 00015 00017 class NvFramerateCounter 00018 { 00019 public: 00022 NvFramerateCounter(NvAppBase* app); 00023 00025 ~NvFramerateCounter(); 00026 00031 bool nextFrame(); 00032 00037 void reset(); 00038 00042 float getMeanFramerate() { return m_meanFramerate; } 00043 00047 void setReportFrames(int32_t frames) { m_reportFrames = frames; } 00048 00052 int32_t getReportFrames() { return m_reportFrames; } 00053 00057 void setMaxReportRate(float secs) { m_reportRate = secs; } 00058 00062 float getReportRate() { return m_reportRate; } 00063 00064 protected: 00066 NvStopWatch* m_stopWatch; 00067 int32_t m_reportFrames; 00068 int32_t m_framesSinceReport; 00069 float m_reportRate; 00070 float m_meanFramerate; 00071 }; 00072 00073 #endif