summaryrefslogtreecommitdiff
path: root/public/panorama/controls/source2/renderpanel.h
blob: b6e1c6777290150df8dcfec2c3aef0a938b7bfad (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
//=========== Copyright Valve Corporation, All rights reserved. ===============//
//
// Purpose: 
//=============================================================================//

#ifndef PANORAMA_RENDERPANEL_H
#define PANORAMA_RENDERPANEL_H

#ifdef _WIN32
#pragma once
#endif

#include "panorama/controls/panel2d.h"
#include "materialsystem2/imaterialsystem2utils.h"

namespace panorama
{

//-----------------------------------------------------------------------------
// Purpose: Render panel, to use for raw source2 render operations directly in render thread
//-----------------------------------------------------------------------------
class CRenderPanel : public CPanel2D
{
	DECLARE_PANEL2D( CRenderPanel, CPanel2D );

public:
	CRenderPanel( CPanel2D *parent, const char * pchPanelID );
	virtual ~CRenderPanel();

	void SetRenderThreadCallback( CRenderThreadCallback *pRenderCallback );

	// Override and make return true if you need to paint every single frame, and will not manually call SetRepaint when you want to repaint
	virtual bool BShouldAlwaysRepaint() { return true; }

protected:
	// Override of Panel2D paint
	virtual void Paint() OVERRIDE;

private:
	CRenderThreadCallback *m_pRenderCallback;
};

} // namespace panorama

#endif // PANORAMA_RENDERPANEL_H