summaryrefslogtreecommitdiff
path: root/common/ivprofexport.h
blob: f3d5d11fb736b354aba9b77b8b154a59eb562131 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#ifndef IVPROFEXPORT_H
#define IVPROFEXPORT_H
#ifdef _WIN32
#pragma once
#endif


#include "tier0/vprof.h"


#define VPROF_EXPORT_INTERFACE_VERSION "VProfExport001"
#include <Color.h>

abstract_class IVProfExport
{
public:
	enum
	{
		MAX_BUDGETGROUP_TIMES = 512
	};

	class CExportedBudgetGroupInfo
	{
	public:
		const char *m_pName;
		int m_BudgetFlags;	// Combination of BUDGETFLAG_ defines (in vprof.h)
		Color m_Color;
	};

public:

	// Use this to register and unregister for the vprof data (if you don't, GetBudgetGroupTimes may return no data).
	virtual void AddListener() = 0;
	virtual void RemoveListener() = 0;

	// Pause/resume profiling so it doesn't capture data we don't want.
	virtual void PauseProfile() = 0;
	virtual void ResumeProfile() = 0;

	// Set a combination of BUDGETFLAG_ defines to define what data you're get back.
	// Note: this defines which budget groups to REJECT (ones that have flags that are in filter won't be returned).
	virtual void SetBudgetFlagsFilter( int filter ) = 0;

	// Use budgetFlags to filter out which budget groups you're interested in.
	virtual int GetNumBudgetGroups() = 0;
	
	// pInfos must have space to hold the return value from GetNumBudgetGroups().
	virtual void GetBudgetGroupInfos( CExportedBudgetGroupInfo *pInfos ) = 0;

	virtual void GetBudgetGroupTimes( float times[MAX_BUDGETGROUP_TIMES] ) = 0;
};


#endif // IVPROFEXPORT_H