blob: e756829d21d16865b6cb6b4fbf4996b6f1e25f2b (
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "vgui_int.h"
#include "ienginevgui.h"
#include "vgui_rootpanel_sdk.h"
#include "vgui/IVGui.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
C_SDKRootPanel *g_pRootPanel = NULL;
//-----------------------------------------------------------------------------
// Global functions.
//-----------------------------------------------------------------------------
void VGUI_CreateClientDLLRootPanel( void )
{
g_pRootPanel = new C_SDKRootPanel( enginevgui->GetPanel( PANEL_CLIENTDLL ) );
}
void VGUI_DestroyClientDLLRootPanel( void )
{
delete g_pRootPanel;
g_pRootPanel = NULL;
}
vgui::VPANEL VGui_GetClientDLLRootPanel( void )
{
return g_pRootPanel->GetVPanel();
}
//-----------------------------------------------------------------------------
// C_SDKRootPanel implementation.
//-----------------------------------------------------------------------------
C_SDKRootPanel::C_SDKRootPanel( vgui::VPANEL parent )
: BaseClass( NULL, "SDK Root Panel" )
{
SetParent( parent );
SetPaintEnabled( false );
SetPaintBorderEnabled( false );
SetPaintBackgroundEnabled( false );
// This panel does post child painting
SetPostChildPaintEnabled( true );
// Make it screen sized
SetBounds( 0, 0, ScreenWidth(), ScreenHeight() );
// Ask for OnTick messages
vgui::ivgui()->AddTickSignal( GetVPanel() );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
C_SDKRootPanel::~C_SDKRootPanel( void )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_SDKRootPanel::PostChildPaint()
{
BaseClass::PostChildPaint();
// Draw all panel effects
RenderPanelEffects();
}
//-----------------------------------------------------------------------------
// Purpose: For each panel effect, check if it wants to draw and draw it on
// this panel/surface if so
//-----------------------------------------------------------------------------
void C_SDKRootPanel::RenderPanelEffects( void )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_SDKRootPanel::OnTick( void )
{
}
//-----------------------------------------------------------------------------
// Purpose: Reset effects on level load/shutdown
//-----------------------------------------------------------------------------
void C_SDKRootPanel::LevelInit( void )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_SDKRootPanel::LevelShutdown( void )
{
}
|