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

Abstract base for a single game state (scene / screen). More...

#include <flint/core/state.h>

+ Collaboration diagram for Flint::State:

Public Member Functions

virtual void handleInput (IWindow &window)=0
 Process raw input events and translate them into state-specific actions.
 
virtual void update (float deltaTime)=0
 Advance the simulation logic for this state by deltaTime seconds.
 
virtual void render (GPURenderer &gpuRenderer, IWindow &window)=0
 Issue all draw calls necessary to visualize this state.
 
virtual void onEnter ()
 Called immediately after this state becomes the top of the stack.
 
virtual void onExit ()
 Called immediately before this state is removed from the top of the stack.
 

Protected Attributes

std::string m_contextName
 

Detailed Description

Abstract base for a single game state (scene / screen).

Each concrete State owns its own input handling, update logic, and rendering. States are managed on a stack by StateManager and receive lifecycle callbacks via onEnter() / onExit().

Definition at line 25 of file state.h.

Member Function Documentation

◆ handleInput()

virtual void Flint::State::handleInput ( IWindow & window)
pure virtual

Process raw input events and translate them into state-specific actions.

Parameters
windowWindow providing input state (keyboard, mouse, focus, etc.).

◆ onEnter()

virtual void Flint::State::onEnter ( )
inlinevirtual

Called immediately after this state becomes the top of the stack.

Override to (re-)initialize transient state or start animations.

Definition at line 55 of file state.h.

◆ onExit()

virtual void Flint::State::onExit ( )
inlinevirtual

Called immediately before this state is removed from the top of the stack.

Override to persist data, stop sounds, or clean up transient resources.

Definition at line 63 of file state.h.

◆ render()

virtual void Flint::State::render ( GPURenderer & gpuRenderer,
IWindow & window )
pure virtual

Issue all draw calls necessary to visualize this state.

Parameters
gpuRendererRenderer used for submitting GPU work.
windowWindow supplying viewport and swap-chain context.

◆ update()

virtual void Flint::State::update ( float deltaTime)
pure virtual

Advance the simulation logic for this state by deltaTime seconds.

Parameters
deltaTimeTime elapsed since the previous update call.

Member Data Documentation

◆ m_contextName

std::string Flint::State::m_contextName
protected

Definition at line 67 of file state.h.


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