Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::Application Class Referenceabstract

Entry-point base class for a Flint application. More...

#include <flint/core/application.h>

+ Collaboration diagram for Flint::Application:

Public Member Functions

FLINT_API Application (const FlintConfig &config, IAssetLoader *assetLoader=nullptr)
 Construct and initialize a Flint application.
 
FLINT_API Application (const FlintConfig &config, IAssetLoader &assetLoader)
 
FLINT_API void run ()
 
IWindow & getWindow ()
 returns A window reference.
 
GPURenderer & getRenderer () const
 returns A reference to the GPU renderer.
 
UISystem & getUISystem ()
 Returns the UI system.
 
UICanvas & getUICanvas ()
 Returns the UI renderer.
 
FLINT_API std::string loadUIContent (const std::string &filePath)
 
StateManager & getStateManager ()
 returns A reference to the state manager.
 
Audio & getAudioEngine ()
 returns A reference to the audio engine.
 
IAssetLoader & getAssetLoader ()
 returns A reference to the asset loader
 
AssetManager & getAssetManager ()
 
const AssetManager & getAssetManager () const
 
const FlintConfig & getConfig () const
 
virtual FLINT_API void close ()
 

Protected Member Functions

virtual std::unique_ptr< State > createInitialState ()=0
 Factory method that creates the game state pushed into the stack.
 
virtual void onInit ()
 Optional hook called after engine is fully initialized.
 
virtual void onUpdate (float deltaTime)
 
virtual void onShutdown ()
 Optional hook called just before the engine shuts down.
 

Detailed Description

Entry-point base class for a Flint application.

Definition at line 28 of file application.h.

Constructor & Destructor Documentation

◆ Application() [1/2]

FLINT_API Flint::Application::Application ( const FlintConfig & config,
IAssetLoader * assetLoader = nullptr )

Construct and initialize a Flint application.

Create and initialize application systems (window GPU renderer, Audio engine, and input manager)

Parameters
configConfigurations
assetLoaderAsset loader used by the render and games states.

◆ Application() [2/2]

FLINT_API Flint::Application::Application ( const FlintConfig & config,
IAssetLoader & assetLoader )
inline

Definition at line 41 of file application.h.

Member Function Documentation

◆ createInitialState()

virtual std::unique_ptr< State > Flint::Application::createInitialState ( )
protectedpure virtual

Factory method that creates the game state pushed into the stack.

Called once in during run() before the main loop begins.

Returns
Owning pointer to the initial State.

◆ getAssetLoader()

IAssetLoader & Flint::Application::getAssetLoader ( )
inline

returns A reference to the asset loader

Definition at line 81 of file application.h.

◆ getAssetManager() [1/2]

AssetManager & Flint::Application::getAssetManager ( )
inline

Definition at line 85 of file application.h.

◆ getAssetManager() [2/2]

const AssetManager & Flint::Application::getAssetManager ( ) const
inline

Definition at line 89 of file application.h.

◆ getAudioEngine()

Audio & Flint::Application::getAudioEngine ( )
inline

returns A reference to the audio engine.

Definition at line 76 of file application.h.

◆ getConfig()

const FlintConfig & Flint::Application::getConfig ( ) const
inline

Definition at line 93 of file application.h.

◆ getRenderer()

GPURenderer & Flint::Application::getRenderer ( ) const
inline

returns A reference to the GPU renderer.

Definition at line 54 of file application.h.

◆ getStateManager()

StateManager & Flint::Application::getStateManager ( )
inline

returns A reference to the state manager.

Definition at line 71 of file application.h.

◆ getUICanvas()

UICanvas & Flint::Application::getUICanvas ( )
inline

Returns the UI renderer.

Definition at line 64 of file application.h.

◆ getUISystem()

UISystem & Flint::Application::getUISystem ( )
inline

Returns the UI system.

Definition at line 59 of file application.h.

◆ getWindow()

IWindow & Flint::Application::getWindow ( )
inline

returns A window reference.

Definition at line 49 of file application.h.

◆ onInit()

virtual void Flint::Application::onInit ( )
inlineprotectedvirtual

Optional hook called after engine is fully initialized.

Override to perform an additional one-time setup before the first frame.

Definition at line 114 of file application.h.

◆ onShutdown()

virtual void Flint::Application::onShutdown ( )
inlineprotectedvirtual

Optional hook called just before the engine shuts down.

Override to release resources that depend on the engine still being alive.

Definition at line 126 of file application.h.

◆ onUpdate()

virtual void Flint::Application::onUpdate ( float deltaTime)
inlineprotectedvirtual

Definition at line 117 of file application.h.


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