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.

78 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // Purpose: Defines a group of app systems that all have the same lifetime
  6. // that need to be connected/initialized, etc. in a well-defined order
  7. //
  8. // $NoKeywords: $
  9. //
  10. //===========================================================================//
  11. #ifndef DEDICATED_H
  12. #define DEDICATED_H
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16. #include "appframework/tier3app.h"
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. class IDedicatedServerAPI;
  21. //-----------------------------------------------------------------------------
  22. // Singleton interfaces
  23. //-----------------------------------------------------------------------------
  24. extern IDedicatedServerAPI *engine;
  25. extern char g_szEXEName[ MAX_PATH ];
  26. //-----------------------------------------------------------------------------
  27. // Inner loop: initialize, shutdown main systems, load steam to
  28. //-----------------------------------------------------------------------------
  29. #ifdef POSIX
  30. #define DEDICATED_BASECLASS CTier2SteamApp
  31. #else
  32. #define DEDICATED_BASECLASS CVguiSteamApp
  33. #endif
  34. class CDedicatedAppSystemGroup : public DEDICATED_BASECLASS
  35. {
  36. typedef DEDICATED_BASECLASS BaseClass;
  37. public:
  38. // Methods of IApplication
  39. virtual bool Create( );
  40. virtual bool PreInit( );
  41. virtual int Main( );
  42. virtual void PostShutdown();
  43. virtual void Destroy();
  44. // Used to chain to base class
  45. AppModule_t LoadModule( CreateInterfaceFn factory )
  46. {
  47. return CSteamAppSystemGroup::LoadModule( factory );
  48. }
  49. // Method to add various global singleton systems
  50. bool AddSystems( AppSystemInfo_t *pSystems )
  51. {
  52. return CSteamAppSystemGroup::AddSystems( pSystems );
  53. }
  54. void *FindSystem( const char *pInterfaceName )
  55. {
  56. return CSteamAppSystemGroup::FindSystem( pInterfaceName );
  57. }
  58. };
  59. #endif // DEDICATED_H