Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.9 KiB

  1. //========= Copyright � 1996-2001, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include "toolutils/vgui_tools.h"
  8. #include "ienginevgui.h"
  9. #include <vgui/isurface.h>
  10. #include <vgui/IVGui.h>
  11. #include <vgui/IInput.h>
  12. #include "tier0/vprof.h"
  13. #include <vgui_controls/Panel.h>
  14. #include <KeyValues.h>
  15. #include <dme_controls/dmeControls.h>
  16. // memdbgon must be the last include file in a .cpp file!!!
  17. #include "tier0/memdbgon.h"
  18. using namespace vgui;
  19. //-----------------------------------------------------------------------------
  20. // Purpose:
  21. // Input : appSystemFactory -
  22. // Output : Returns true on success, false on failure.
  23. //-----------------------------------------------------------------------------
  24. bool VGui_Startup( CreateInterfaceFn appSystemFactory )
  25. {
  26. // All of the various tools .dlls expose GetVGuiControlsModuleName() to us to make sure we don't have communication across .dlls
  27. if ( !vgui::VGui_InitDmeInterfacesList( GetVGuiControlsModuleName(), &appSystemFactory, 1 ) )
  28. return false;
  29. return true;
  30. }
  31. //-----------------------------------------------------------------------------
  32. // Purpose:
  33. // Input : -
  34. // Output : Returns true on success, false on failure.
  35. //-----------------------------------------------------------------------------
  36. bool VGui_PostInit()
  37. {
  38. // Create any root panels for .dll
  39. VGUI_CreateToolRootPanel();
  40. // Make sure we have a panel
  41. VPANEL root = VGui_GetToolRootPanel();
  42. if ( !root )
  43. {
  44. return false;
  45. }
  46. return true;
  47. }
  48. //-----------------------------------------------------------------------------
  49. // Purpose:
  50. // Input : -
  51. //-----------------------------------------------------------------------------
  52. void VGui_Shutdown()
  53. {
  54. VGUI_DestroyToolRootPanel();
  55. // Make sure anything "marked for deletion"
  56. // actually gets deleted before this dll goes away
  57. vgui::ivgui()->RunFrame();
  58. }