ezEngine  Milestone 7
ezGameApplication Class Reference
Inheritance diagram for ezGameApplication:

Classes

struct  WindowContext
 

Public Member Functions

 ezGameApplication (ezGameStateBase &initialGameState)
 
virtual
ezApplication::ApplicationExecution 
Run () override
 Main run function which is called periodically. This function must be overridden. More...
 
ezGALSwapChainHandle AddWindow (ezWindowBase *pWindow)
 
void RemoveWindow (ezWindowBase *pWindow)
 
ezGALSwapChainHandle GetSwapChain (const ezWindowBase *pWindow) const
 
void SetCurrentGameState (ezGameStateBase &currentGameState)
 
EZ_FORCE_INLINE ezGameStateBaseGetCurrentGameState () const
 
void RequestQuit ()
 
EZ_FORCE_INLINE bool WasQuitRequested () const
 
void SetupProject (const char *szProjectDir)
 
- Public Member Functions inherited from ezApplication
 ezApplication ()
 Constructor.
 
virtual ~ezApplication ()
 Virtual destructor.
 
virtual void BeforeEngineInit ()
 This function is called before any kind of engine initialization is done. More...
 
virtual void AfterEngineShutdown ()
 This function is called after ezStartup::ShutdownBase() has been called. More...
 
virtual void BeforeEnterBackground ()
 This function is called when an application is moved to the background. More...
 
virtual void BeforeEnterForeground ()
 This function is called whenever an application is resumed from background mode. More...
 
void SetReturnCode (ezInt32 iReturnCode)
 Sets the value that the application will return to the OS. You can call this function at any point during execution to update the return value of the application. Default is zero.
 
ezInt32 GetReturnCode () const
 Returns the currently set value that the application will return to the OS.
 
void SetCommandLineArguments (ezUInt32 uiArgumentCount, const char **ppArguments)
 Will set the command line arguments that were passed to the app by the OS. This is automatically called by EZ_APPLICATION_ENTRY_POINT() and EZ_CONSOLEAPP_ENTRY_POINT().
 
ezUInt32 GetArgumentCount () const
 Returns the number of command lien arguments that were passed to the application. More...
 
const char * GetArgument (ezUInt32 uiArgument) const
 Returns one of the command line arguments that was passed to the application.
 
const char ** GetArgumentsArray () const
 Returns the complete array of command line arguments that were passed to the application.
 
void EnableMemoryLeakReporting (bool bEnable)
 

Protected Member Functions

void UpdateWorldsAndRender ()
 
virtual void AfterEngineInit () override
 This function is called after basic engine initialization has been done. More...
 
virtual void BeforeEngineShutdown () override
 This function is called after the application main loop has run for the last time, before engine deinitialization. More...
 

Private Member Functions

void SetupDefaultResources ()
 
void UpdateInput ()
 
void UpdateWorldsAndExtractViews ()
 

Private Attributes

ezDelegateTask< void > m_UpdateTask
 
ezDynamicArray< WindowContextm_Windows
 
ezDefaultTimeStepSmoothing m_TimeStepSmoother
 
ezGameStateBasem_pCurrentGameState
 
bool m_bWasQuitRequested
 

Additional Inherited Members

- Public Types inherited from ezApplication
enum  ApplicationExecution { Continue, Quit }
 Defines the possible return values for the ezApplication::Run() function. More...
 
- Static Public Member Functions inherited from ezApplication
static ezApplicationGetApplicationInstance ()
 Returns the one instance of ezApplication that is available.
 

Class Documentation

struct ezGameApplication::WindowContext
Class Members
ezGALSwapChainHandle m_hSwapChain
ezWindowBase * m_pWindow

Member Function Documentation

void ezGameApplication::AfterEngineInit ( )
overrideprotectedvirtual

This function is called after basic engine initialization has been done.

ezApplication will automatically call ezStartup::StartupCore() to initialize the application. This function can be overridden to do additional application specific initialization. To startup entire subsystems, you should however use the features provided by ezStartup and ezSubSystem.

Reimplemented from ezApplication.

void ezGameApplication::BeforeEngineShutdown ( )
overrideprotectedvirtual

This function is called after the application main loop has run for the last time, before engine deinitialization.

Override this function to do application specific deinitialization that still requires a running engine. After this function returns ezStartup::ShutdownBase() is called and thus everything, including allocators, is shut down. To shut down entire subsystems, you should however use the features provided by ezStartup and ezSubSystem.

Reimplemented from ezApplication.

ezApplication::ApplicationExecution ezGameApplication::Run ( )
overridevirtual

Main run function which is called periodically. This function must be overridden.

Return ApplicationExecution::Quit when the application should quit. You may set a return code via SetReturnCode() beforehand.

Implements ezApplication.

void ezGameApplication::UpdateWorldsAndRender ( )
protected
Todo:
: there should also be a clock per world

The documentation for this class was generated from the following files: