Interfaces used to initialize a game using CryEngine
struct IGameStartup { };
IGameStartup.h
virtual ~IGameStartup();
virtual const char* GetPatch() const = 0;
path+filename if patch to install, null otherwise
Returns whether a patch needs installing
virtual bool GetRestartLevel(char** levelName) = 0;
NULL to quit the game, a levelname to restart with that level
Returns a restart level and thus triggers a restart.
virtual bool GetRestartMod(char* pModName, int nameLenMax) = 0;
true will indicates that a mod is requested
Retrieves the next mod to use in case the engine got a restart request.
virtual const uint8* GetRSAKey(uint32 * pKeySize) const;
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.
virtual IGameRef Init(SSystemInitParams & startupParams) = 0;
Parameters |
Description |
SSystemInitParams & startupParams |
Pointer to SSystemInitParams structure containing system initialization setup! |
Pointer to a IGameMod interface, or 0 if something went wrong with initialization.
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.
virtual int Run(const char * autoStartLevelName) = 0;
Parameters |
Description |
const char * autoStartLevelName |
name of the level to jump into, or NULL for normal behaviour |
0 when the game terminated normally, non-zero otherwise
Initiate and control the game loop!
virtual void Shutdown() = 0;
Shuts down the game and any loaded MOD and delete itself.
virtual int Update(bool haveFocus, unsigned int updateFlags) = 0;
Parameters |
Description |
bool haveFocus |
Boolean describing if the game has the input focus or not. |
0 to terminate the game (i.e. when quitting), non-zero to continue
Updates the game.
Entry function to the game
typedef IGameStartup * (* TEntryFunction)();
a new instance of the game startup
Entry function used to create a new instance of the game