mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
First version of the SOurce SDK 2013
This commit is contained in:
106
game/client/sdk/vgui/vgui_rootpanel_sdk.cpp
Normal file
106
game/client/sdk/vgui/vgui_rootpanel_sdk.cpp
Normal file
@ -0,0 +1,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 )
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user