Team Fortress 2 Source Code as on 22/4/2020
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.

121 lines
3.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // The copyright to the contents herein is the property of Valve, L.L.C.
  4. // The contents may be used and/or copied only with the written permission of
  5. // Valve, L.L.C., or in accordance with the terms and conditions stipulated in
  6. // the agreement/contract under which the contents have been supplied.
  7. //
  8. // $Header: $
  9. // $NoKeywords: $
  10. //
  11. // The application objects for apps that use tier3
  12. //=============================================================================
  13. #ifndef TIER3APP_H
  14. #define TIER3APP_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include "appframework/tier2app.h"
  19. #include "tier3/tier3.h"
  20. #include "vgui_controls/Controls.h"
  21. //-----------------------------------------------------------------------------
  22. // The application object for apps that use tier3
  23. //-----------------------------------------------------------------------------
  24. class CTier3SteamApp : public CTier2SteamApp
  25. {
  26. typedef CTier2SteamApp BaseClass;
  27. public:
  28. // Methods of IApplication
  29. virtual bool PreInit()
  30. {
  31. if ( !BaseClass::PreInit() )
  32. return false;
  33. CreateInterfaceFn factory = GetFactory();
  34. ConnectTier3Libraries( &factory, 1 );
  35. return true;
  36. }
  37. virtual void PostShutdown()
  38. {
  39. DisconnectTier3Libraries();
  40. BaseClass::PostShutdown();
  41. }
  42. };
  43. //-----------------------------------------------------------------------------
  44. // The application object for apps that use tier3
  45. //-----------------------------------------------------------------------------
  46. class CTier3DmSteamApp : public CTier2DmSteamApp
  47. {
  48. typedef CTier2DmSteamApp BaseClass;
  49. public:
  50. // Methods of IApplication
  51. virtual bool PreInit()
  52. {
  53. if ( !BaseClass::PreInit() )
  54. return false;
  55. CreateInterfaceFn factory = GetFactory();
  56. ConnectTier3Libraries( &factory, 1 );
  57. return true;
  58. }
  59. virtual void PostShutdown()
  60. {
  61. DisconnectTier3Libraries();
  62. BaseClass::PostShutdown();
  63. }
  64. };
  65. //-----------------------------------------------------------------------------
  66. // The application object for apps that use vgui
  67. //-----------------------------------------------------------------------------
  68. class CVguiSteamApp : public CTier3SteamApp
  69. {
  70. typedef CTier3SteamApp BaseClass;
  71. public:
  72. // Methods of IApplication
  73. virtual bool PreInit()
  74. {
  75. if ( !BaseClass::PreInit() )
  76. return false;
  77. CreateInterfaceFn factory = GetFactory();
  78. return vgui::VGui_InitInterfacesList( "CVguiSteamApp", &factory, 1 );
  79. }
  80. };
  81. //-----------------------------------------------------------------------------
  82. // The application object for apps that use vgui
  83. //-----------------------------------------------------------------------------
  84. class CVguiDmSteamApp : public CTier3DmSteamApp
  85. {
  86. typedef CTier3DmSteamApp BaseClass;
  87. public:
  88. // Methods of IApplication
  89. virtual bool PreInit()
  90. {
  91. if ( !BaseClass::PreInit() )
  92. return false;
  93. CreateInterfaceFn factory = GetFactory();
  94. return vgui::VGui_InitInterfacesList( "CVguiSteamApp", &factory, 1 );
  95. }
  96. };
  97. #endif // TIER3APP_H