source-engine/engine/cbenchmark.h

60 lines
1.3 KiB
C
Raw Permalink Normal View History

2020-04-22 16:56:21 +00:00
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//===========================================================================//
#ifndef CBENCHMARK_H
#define CBENCHMARK_H
#ifdef _WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CCommand;
#define MAX_BUFFER_SIZE 2048
//-----------------------------------------------------------------------------
// Purpose: Holds benchmark data & state
//-----------------------------------------------------------------------------
class CBenchmarkResults
{
public:
CBenchmarkResults();
bool IsBenchmarkRunning();
void StartBenchmark( const CCommand &args );
void StopBenchmark();
void SetResultsFilename( const char *pFilename );
void Upload();
2022-11-16 10:51:03 +00:00
void Frame();
2020-04-22 16:56:21 +00:00
private:
bool m_bIsTestRunning;
char m_szFilename[256];
2022-11-16 10:51:03 +00:00
float m_flStartTime;
2020-04-22 16:56:21 +00:00
int m_iStartFrame;
2022-11-16 10:51:03 +00:00
float m_flNextSecondTime;
int m_iNextSecondFrame;
CUtlVector<int> m_FPSInfo;
2020-04-22 16:56:21 +00:00
};
inline CBenchmarkResults *GetBenchResultsMgr()
{
extern CBenchmarkResults g_BenchmarkResults;
return &g_BenchmarkResults;
}
#endif // CBENCHMARK_H