r5sdk/r5dev/common/engine_launcher_api.h
Kawe Mazidjatari f120354e96 Initial port to CMake
* All libraries have been isolated from each other, and build into separate artifacts.
* Project has been restructured to support isolating libraries.
* CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example).
* Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp).

TODO:
* Add a batch file to autogenerate all projects.
* Add support for dedicated server.
* Add support for client dll.

Bugs:
* Game crashes on the title screen after the UI script compiler has finished (root cause unknown).
* Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
2023-05-10 00:05:38 +02:00

70 lines
2.0 KiB
C++
Raw Blame History

//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ========//
//
// Purpose: engine/launcher interface
//
// $NoKeywords: $
//=============================================================================//
#ifndef ENGINE_LAUNCHER_APIH
#define ENGINE_LAUNCHER_APIH
#include "public/appframework/IAppSystem.h"
struct StartupInfo_t
{
void* m_pInstance;
const char m_szBaseDirectory[260];
const char m_szInitialMod[260];
const char m_szInitialGame[260];
uint8_t m_pParentAppSystemGroup[236];
bool m_bTextMode;
};
//-----------------------------------------------------------------------------
// Return values from the initialization stage of the application framework
//-----------------------------------------------------------------------------
enum
{
INIT_RESTART = INIT_LAST_VAL,
RUN_FIRST_VAL,
};
//-----------------------------------------------------------------------------
// Return values from IEngineAPI::Run.
//-----------------------------------------------------------------------------
enum
{
RUN_OK = RUN_FIRST_VAL,
RUN_RESTART,
};
//-----------------------------------------------------------------------------
// Main engine interface to launcher + tools
//-----------------------------------------------------------------------------
#define VENGINE_LAUNCHER_API_VERSION "VENGINE_LAUNCHER_API_VERSION004"
abstract_class IEngineAPI : public IAppSystem
{
// Functions
public:
// This function must be called before init
virtual bool SetStartupInfo(StartupInfo_t & info) = 0;
// Run the engine
virtual int Run() = 0;
// Sets the engine to run in a particular editor window
virtual void PostConsoleCommand(const char* pConsoleCommand) = 0;
// Are we running the simulation?
virtual bool IsRunningSimulation() const = 0;
// Start/stop running the simulation
virtual void ActivateSimulation(bool bActive) = 0;
// Reset the map we're on
virtual void SetMap(const char* pMapName) = 0;
};
#endif // ENGINE_LAUNCHER_APIH