diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/perfvisualbenchmark.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/perfvisualbenchmark.h')
| -rw-r--r-- | mp/src/game/client/perfvisualbenchmark.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/mp/src/game/client/perfvisualbenchmark.h b/mp/src/game/client/perfvisualbenchmark.h new file mode 100644 index 00000000..09b843b7 --- /dev/null +++ b/mp/src/game/client/perfvisualbenchmark.h @@ -0,0 +1,65 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+
+#if !defined PERFVISUALBENCHMARK_H
+#define PERFVISUALBENCHMARK_H
+
+#define FPS_STABILIZE_TIME 1.5
+#define FPS_STABILIZE_TIME_RELOAD_MATERIALS 10.0
+#define FPS_MEASURE_TIME 2.0
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <igameevents.h>
+#include <igamesystem.h>
+
+class CPerfVisualBenchmark : public CBaseGameSystemPerFrame
+{
+
+public:
+ CPerfVisualBenchmark();
+ virtual ~CPerfVisualBenchmark();
+
+public: // CBaseGameSystem overrides
+
+ virtual char const *Name() { return "CPerfVisualBenchmark"; }
+
+ virtual bool Init();
+ virtual void PreRender( );
+
+ void Start();
+ void Stop();
+
+private:
+ void Print();
+ struct RunInfo_t
+ {
+ const char *m_pVarName;
+ const char *m_pOnVal;
+ const char *m_pOffVal;
+ const char *m_pDescription;
+ float m_flStabilizeTime;
+ float m_flFPS;
+ };
+
+private:
+ CUtlVector<RunInfo_t> m_RunInfo;
+ bool m_bIsOn; //is this thing on?
+ int m_iCurVar; //what convar are we at?
+ float m_flTimer; //time since we started measuring the current convar
+ float m_flStartMeasureTime;
+ int m_nStartFrameCount;
+ bool m_bSaveMouseEnable; // remember this so that we can reset it after the benchmark
+ bool m_bWaiting;
+};
+
+extern IGameSystem* PerfVisualBenchmark();
+
+#endif // PERFVISUALBENCHMARK_H
|