ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
Imago::Engine::EngineControl Class Reference

The user's only way to talk to the Game from inside a system or Scene load/unload. More...

#include <Imago/Engine/EngineControl.hpp>

Public Member Functions

 EngineControl ()=default
 Construct a new Engine Control object.
 EngineControl (const EngineControl &)=delete
EngineControl & operator= (const EngineControl &)=delete
 EngineControl (EngineControl &&)=delete
EngineControl & operator= (EngineControl &&)=delete
void switch_scene (const std::string &name, bool persist=false)
 Requests a switch to a registered Scene. Called by the user within a system through the engine field in SceneContext. If called more than once in a frame, the last call wins.
void quit ()
 Requests that the game ends. Called by the user within a system through the engine field in SceneContext. The current frame finishes and any pending scene change is skipped.

Friends

class Game
struct EngineControlTestAccess

Detailed Description

The user's only way to talk to the Game from inside a system or Scene load/unload.

Every method only records a request and returns immediatley. Game then consumes and applies the request at the end of each frame, so the rest of the current fram still runs after a call.

Member Function Documentation

◆ switch_scene()

void Imago::Engine::EngineControl::switch_scene ( const std::string & name,
bool persist = false )

Requests a switch to a registered Scene. Called by the user within a system through the engine field in SceneContext. If called more than once in a frame, the last call wins.

Parameters
name
persist

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