From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- tools/toolutils/vgui_tools.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tools/toolutils/vgui_tools.cpp (limited to 'tools/toolutils/vgui_tools.cpp') diff --git a/tools/toolutils/vgui_tools.cpp b/tools/toolutils/vgui_tools.cpp new file mode 100644 index 0000000..f60c1e5 --- /dev/null +++ b/tools/toolutils/vgui_tools.cpp @@ -0,0 +1,67 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include "toolutils/vgui_tools.h" +#include "ienginevgui.h" +#include +#include +#include +#include "tier0/vprof.h" +#include +#include +#include + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +using namespace vgui; + +//----------------------------------------------------------------------------- +// Purpose: +// Input : appSystemFactory - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +bool VGui_Startup( CreateInterfaceFn appSystemFactory ) +{ + // All of the various tools .dlls expose GetVGuiControlsModuleName() to us to make sure we don't have communication across .dlls + if ( !vgui::VGui_InitDmeInterfacesList( GetVGuiControlsModuleName(), &appSystemFactory, 1 ) ) + return false; + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +bool VGui_PostInit() +{ + // Create any root panels for .dll + VGUI_CreateToolRootPanel(); + + // Make sure we have a panel + VPANEL root = VGui_GetToolRootPanel(); + if ( !root ) + { + return false; + } + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : - +//----------------------------------------------------------------------------- +void VGui_Shutdown() +{ + VGUI_DestroyToolRootPanel(); + + // Make sure anything "marked for deletion" + // actually gets deleted before this dll goes away + vgui::ivgui()->RunFrame(); +} -- cgit v1.2.3