2023-10-14 00:19:02 +08:00
|
|
|
|
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
2015-07-11 13:56:04 -04:00
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
//=============================================================================//
|
|
|
|
|
|
|
|
|
|
#ifndef IENGINESERVICE_H
|
|
|
|
|
#define IENGINESERVICE_H
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <appframework/IAppSystem.h>
|
2023-10-14 00:19:02 +08:00
|
|
|
|
#include <inputsystem/InputEnums.h>
|
|
|
|
|
#include <iloopmode.h>
|
2015-07-11 13:56:04 -04:00
|
|
|
|
|
2023-10-13 13:08:04 -04:00
|
|
|
|
class ISwitchLoopModeStatusNotify;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
class IAddonListChangeNotify;
|
|
|
|
|
|
2023-10-14 00:19:02 +08:00
|
|
|
|
struct EventClientOutput_t
|
|
|
|
|
{
|
|
|
|
|
EngineLoopState_t m_LoopState;
|
|
|
|
|
float m_flRenderTime;
|
|
|
|
|
float m_flRealTime;
|
|
|
|
|
};
|
|
|
|
|
|
2015-07-11 13:56:04 -04:00
|
|
|
|
abstract_class IEngineService : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void *GetServiceDependencies( void ) = 0;
|
|
|
|
|
virtual const char *GetName( void ) const = 0;
|
|
|
|
|
virtual bool ShouldActivate( const char * ) = 0;
|
2023-10-13 13:08:04 -04:00
|
|
|
|
virtual void OnLoopActivate( const EngineLoopState_t &loopState, CEventDispatcher<CEventIDManager_Default> *pEventDispatcher) = 0;
|
|
|
|
|
virtual void OnLoopDeactivate( const EngineLoopState_t &loopState, CEventDispatcher<CEventIDManager_Default> *pEventDispatcher) = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual bool IsActive( void ) const = 0;
|
|
|
|
|
virtual void SetActive( bool ) = 0;
|
|
|
|
|
virtual void SetName( const char *pszName ) = 0;
|
2023-10-13 13:08:04 -04:00
|
|
|
|
virtual void RegisterEventMap( CEventDispatcher<CEventIDManager_Default> *pEventDispatcher, EventMapRegistrationType_t nRegistrationType ) = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual uint16 GetServiceIndex( void ) = 0;
|
|
|
|
|
virtual void SetServiceIndex( uint16 index ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-14 00:19:02 +08:00
|
|
|
|
abstract_class IEngineServiceMgr : public IAppSystem, public ILoopModePrerequisiteRegistry
|
2015-07-11 13:56:04 -04:00
|
|
|
|
{
|
|
|
|
|
public:
|
2023-10-14 00:19:02 +08:00
|
|
|
|
virtual void RegisterEngineService( const char *psServiceName, IEngineService *pService ) = 0;
|
|
|
|
|
virtual void UnregisterEngineService( const char *pszServiceName, IEngineService *pService ) = 0;
|
|
|
|
|
virtual void RegisterLoopMode( const char *pLoopModeName, ILoopModeFactory *pLoopModeFactory, void **ppGlobalPointer ) = 0;
|
|
|
|
|
virtual void UnregisterLoopMode( const char *pLoopModeName, ILoopModeFactory *pLoopModeFactory, void **ppGlobalPointer ) = 0;
|
|
|
|
|
virtual void SwitchToLoop( const char *pszLoopModeName, KeyValues *pkvLoopOptions, uint32 nId, const char *pszAddonName, bool ) = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual const char *GetActiveLoopName( void ) const = 0;
|
|
|
|
|
virtual IEngineService *FindService( const char * ) = 0;
|
2023-10-14 00:19:02 +08:00
|
|
|
|
virtual PlatWindow_t GetEngineWindow( void ) const = 0;
|
2023-10-13 13:08:04 -04:00
|
|
|
|
virtual SwapChainHandle_t GetEngineSwapChain( void ) const = 0;
|
|
|
|
|
virtual InputContextHandle_t GetEngineInputContext( void ) const = 0;
|
2015-09-21 14:00:00 -04:00
|
|
|
|
virtual void *GetEngineDeviceInfo( void ) const = 0;
|
|
|
|
|
virtual int GetEngineDeviceWidth( void ) const = 0;
|
|
|
|
|
virtual int GetEngineDeviceHeight( void ) const = 0;
|
|
|
|
|
virtual int GetEngineSwapChainSize( void ) const = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual bool IsLoopSwitchQueued( void ) const = 0;
|
|
|
|
|
virtual bool IsLoopSwitchRequested( void ) const = 0;
|
2023-10-13 13:08:04 -04:00
|
|
|
|
virtual CEventDispatcher<CEventIDManager_Default> *GetEventDispatcher( void ) = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual void *GetDebugVisualizerMgr( void ) = 0;
|
|
|
|
|
virtual int GetActiveLoopClientServerMode( void ) const = 0;
|
|
|
|
|
virtual void EnableMaxFramerate( bool ) = 0;
|
|
|
|
|
virtual void OverrideMaxFramerate( float ) = 0;
|
|
|
|
|
virtual void PrintStatus( void ) = 0;
|
2023-10-14 00:19:02 +08:00
|
|
|
|
virtual ActiveLoop_t GetActiveLoop( void ) = 0;
|
2015-07-11 13:56:04 -04:00
|
|
|
|
virtual bool IsLoadingLevel( void ) const = 0;
|
|
|
|
|
virtual bool IsInGameLoop( void ) const = 0;
|
|
|
|
|
virtual void OnFrameRenderingFinished( bool, const EventClientOutput_t & ) = 0;
|
|
|
|
|
virtual void ChangeVideoMode( RenderDeviceInfo_t & ) = 0;
|
|
|
|
|
virtual void GetVideoModeChange( void ) = 0;
|
|
|
|
|
virtual int GetAddonCount( void ) const = 0;
|
|
|
|
|
virtual void GetAddon( int ) const = 0;
|
|
|
|
|
virtual bool IsAddonMounted( const char * ) const = 0;
|
|
|
|
|
virtual const char *GetAddonsString( void ) const = 0;
|
|
|
|
|
virtual void InstallSwitchLoopModeStatusNotify( ISwitchLoopModeStatusNotify * ) = 0;
|
|
|
|
|
virtual void UninstallSwitchLoopModeStatusNotify( ISwitchLoopModeStatusNotify * ) = 0;
|
|
|
|
|
virtual void InstallAddonListChangeNotify( IAddonListChangeNotify * ) = 0;
|
|
|
|
|
virtual void UninstallAddonListChangeNotify( IAddonListChangeNotify * ) = 0;
|
|
|
|
|
virtual void ExitMainLoop( void ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // IENGINESERVICE_H
|