summaryrefslogtreecommitdiff
path: root/common/engine_launcher_api.h
blob: 56b50f318d0db819ff8b141d6f3d0a9deaf5ee59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
// engine/launcher interface
#ifndef ENGINE_LAUNCHER_APIH
#define ENGINE_LAUNCHER_APIH
#ifdef _WIN32
#pragma once
#endif

#include "appframework/IAppSystem.h"

class CAppSystemGroup;


struct StartupInfo_t
{
	void *m_pInstance;
	const char *m_pBaseDirectory;	// Executable directory ("c:/program files/half-life 2", for example)
	const char *m_pInitialMod;		// Mod name ("cstrike", for example)
	const char *m_pInitialGame;		// Root game name ("hl2", for example, in the case of cstrike)
	CAppSystemGroup *m_pParentAppSystemGroup;
	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 void SetStartupInfo( StartupInfo_t &info ) = 0;

	// Run the engine
	virtual int Run( ) = 0;

	// Sets the engine to run in a particular editor window
	virtual void SetEngineWindow( void *hWnd ) = 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