Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::Application Class Referenceabstract

Interface that every runnable game or lab must implement. More...

#include <Application.h>

Public Member Functions

virtual bool Init ()=0
 Called once by Engine::Init() after the GL context is ready.
 
virtual void RegisterTypes ()=0
 
virtual void Update (float deltaTime)=0
 Called every frame by Engine::Run() with the elapsed time.
 
virtual void Destroy ()=0
 Called by Engine::Destroy() before the GL context is torn down. Release GPU resources (meshes, textures, shaders) here.
 
void SetNeedsToBeClosed (bool value)
 Request the engine to stop after the current frame.
 
bool NeedsToBeClosed () const
 Returns true when the application has requested shutdown. Engine::Run() checks this each frame to know when to exit.
 

Detailed Description

Interface that every runnable game or lab must implement.

The Engine singleton owns the Application instance (via std::unique_ptr) and drives its lifecycle through the three virtual methods below.

Definition at line 35 of file Application.h.

Member Function Documentation

◆ Destroy()

virtual void mnd::Application::Destroy ( )
pure virtual

Called by Engine::Destroy() before the GL context is torn down. Release GPU resources (meshes, textures, shaders) here.

◆ Init()

virtual bool mnd::Application::Init ( )
pure virtual

Called once by Engine::Init() after the GL context is ready.

Returns
true if initialisation succeeded; false aborts startup.

◆ NeedsToBeClosed()

bool mnd::Application::NeedsToBeClosed ( ) const

Returns true when the application has requested shutdown. Engine::Run() checks this each frame to know when to exit.

Definition at line 13 of file Application.cpp.

◆ RegisterTypes()

void mnd::Application::RegisterTypes ( )
pure virtual

Definition at line 6 of file Application.cpp.

◆ SetNeedsToBeClosed()

void mnd::Application::SetNeedsToBeClosed ( bool  value)

Request the engine to stop after the current frame.

Parameters
valuetrue to signal shutdown, false to keep running.

Definition at line 8 of file Application.cpp.

◆ Update()

virtual void mnd::Application::Update ( float  deltaTime)
pure virtual

Called every frame by Engine::Run() with the elapsed time.

Parameters
deltaTimeSeconds since the previous frame. Use this to make movement and animations frame-rate independent.

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