summaryrefslogtreecommitdiff
path: root/tools/toolutils/vgui_tools.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /tools/toolutils/vgui_tools.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'tools/toolutils/vgui_tools.cpp')
-rw-r--r--tools/toolutils/vgui_tools.cpp67
1 files changed, 67 insertions, 0 deletions
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 <vgui/ISurface.h>
+#include <vgui/IVGui.h>
+#include <vgui/IInput.h>
+#include "tier0/vprof.h"
+#include <vgui_controls/Panel.h>
+#include <KeyValues.h>
+#include <dme_controls/dmeControls.h>
+
+// 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();
+}