IGameStartup

Interfaces used to initialize a game using CryEngine

C++
struct IGameStartup {
};
File

IGameStartup.h

IGameStartup::~IGameStartup Destructor
C++
virtual ~IGameStartup();
IGameStartup::GetPatch Method
C++
virtual const char* GetPatch() const = 0;
Returns

path+filename if patch to install, null otherwise

Description

Returns whether a patch needs installing

IGameStartup::GetRestartLevel Method
C++
virtual bool GetRestartLevel(char** levelName) = 0;
Returns

NULL to quit the game, a levelname to restart with that level

Description

Returns a restart level and thus triggers a restart.

IGameStartup::GetRestartMod Method
C++
virtual bool GetRestartMod(char* pModName, int nameLenMax) = 0;
Returns

true will indicates that a mod is requested

Description

Retrieves the next mod to use in case the engine got a restart request.

IGameStartup::GetRSAKey Method
C++
virtual const uint8* GetRSAKey(uint32 * pKeySize) const;
Description

Returns the RSA Public Key used by the engine to decrypt pak files which are encrypted by an offline tool. Part of the tools package includes a key generator, which will generate a header file with the public key which can be easily included in code. This *should* ideally be in IGame being game specific info, but paks are loaded very early on during boot and this data is needed to init CryPak.

IGameStartup::Init Method
C++
virtual IGameRef Init(SSystemInitParams & startupParams) = 0;
Parameters
Parameters
Description
SSystemInitParams & startupParams
Pointer to SSystemInitParams structure containing system initialization setup!
Returns

Pointer to a IGameMod interface, or 0 if something went wrong with initialization.

Description

Initialize the game and/or any MOD, and get the IGameMod interface. The shutdown method, must be called independent of this method's return value.

IGameStartup::Run Method
C++
virtual int Run(const char * autoStartLevelName) = 0;
Parameters
Parameters
Description
const char * autoStartLevelName
name of the level to jump into, or NULL for normal behaviour
Returns

0 when the game terminated normally, non-zero otherwise

Description

Initiate and control the game loop!

IGameStartup::Shutdown Method
C++
virtual void Shutdown() = 0;
Description

Shuts down the game and any loaded MOD and delete itself.

IGameStartup::Update Method
C++
virtual int Update(bool haveFocus, unsigned int updateFlags) = 0;
Parameters
Parameters
Description
bool haveFocus
Boolean describing if the game has the input focus or not.
Returns

0 to terminate the game (i.e. when quitting), non-zero to continue

Description

Updates the game.

IGameStartup::TEntryFunction Nested Type

Entry function to the game

C++
typedef IGameStartup * (* TEntryFunction)();
Returns

a new instance of the game startup

Description

Entry function used to create a new instance of the game