Class App

Class Documentation

class DrakoEngine::App

Entry point class of a Game/Application.

Public Types

enum Result

Signals success or failure of some functions.

Values:

enumerator Failure = 0

Indicates some kind of failure.

enumerator Success

Indicates successful execution.

Public Functions

App()
~App()
Result Startup()

Runs before entering the game loop.

Result Shutdown()

Runs after exiting the game loop.

void HandleEvent(sf::Event const &event)

Handles individual events.

void Update()

Updates game or application state once per game loop.

void Render()

Renders graphics to the screen.

Result Run(int argc, char *argv[])

Starts the game loop.

Starts the game loop using the following execution order:

  1. Startup()

  2. Game Loop:

    1. Update()

      1. HandleEvent(event)

    2. Render()

  3. Shutdown()

Public Members

vec<str> Arguments

Holds the command-line arguments.

Protected Functions

Result ClientRun()

Resets the state of the game/application without destroying the window or unloading major engine components.

Resets the game similarly to closing the game and restarting it manually. Execute client Run code such as handling command-line arguments.

Protected Attributes

sf::RenderWindow Window
bool ShouldClose
bool DoSoftReset
bool DoHardReset