Skip to content
Oliver Stanton edited this page Oct 11, 2024 · 2 revisions

The CEngine class manages the window, game world, etc. It's essentially a representation of the application for the game. It contains setup for its members, the main game loop, etc.

To initialise a game in its most minimal state, you first allocate an instance of CEngine:

tails::CEngine engine;

and call the run() member function:

engine.run();

This will create a window that updates and can close via its close button.

If you want to set default settings and parameters for things, you can either move your own SEngineSettings unique pointer into the engine's constructor, or set each setting between the object construction and the run() function:

tails::CEngine engine {std::make_unique<tails::SEngineSettings>(/* ... */)};
engine.setRenderTargetClearColour(sf::Color::Red);
engine.run();

Clone this wiki locally