Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::GameApplication Class Reference

Entry point for all programs using the engine, must instantiate a game application for every new game. Use the macro getGameInstance() to get a pointer to the current game instance. More...

#include <gameApplication.h>

Public Member Functions

void loadScene (std::string const &sceneName, GameScene *newScene)
 Loads in a scene file and stores it in the game application. More...
 
int run (void)
 Starts the main game loop. More...
 
RenderWindowgetWindow (void)
 Returns the reference to the currently active render window. More...
 
double getDeltaTime (void)
 Gets the change in time since the last frame in seconds. More...
 
int getFrameRate (void)
 Gets the number of frames since the last game tick. More...
 
void quitApplication ()
 Shut down the game.
 
void changeScene (std::string const &newScene)
 Change the currently active scene. More...
 
GameScenegetCurrentScene (void)
 Get a pointer to the currently active scene. More...
 

Static Public Member Functions

static GameApplicationgetApplication ()
 

Public Attributes

int m_errorCode
 

Detailed Description

Entry point for all programs using the engine, must instantiate a game application for every new game. Use the macro getGameInstance() to get a pointer to the current game instance.

Warning
This class is a singleton, all functions called operate on the same object.
Author
Thomas Montano
Date
March 2 2020

Member Function Documentation

◆ changeScene()

void rune::GameApplication::changeScene ( std::string const &  newScene)

Change the currently active scene.

Parameters
newSceneThe scene that should be made active.

◆ getApplication()

static GameApplication* rune::GameApplication::getApplication ( )
inlinestatic
Returns
A pointer to the currently open rune::GameApplication.

◆ getCurrentScene()

rune::GameScene * rune::GameApplication::getCurrentScene ( void  )

Get a pointer to the currently active scene.

Returns
A pointer to the currently active scene.

◆ getDeltaTime()

double rune::GameApplication::getDeltaTime ( void  )

Gets the change in time since the last frame in seconds.

Returns
The time in seconds since the last game tick.

◆ getFrameRate()

int rune::GameApplication::getFrameRate ( void  )

Gets the number of frames since the last game tick.

Returns
The number of frames since the last game tick.

◆ getWindow()

rune::RenderWindow * rune::GameApplication::getWindow ( void  )

Returns the reference to the currently active render window.

Returns
the reference to the currently active render window.

◆ loadScene()

void rune::GameApplication::loadScene ( std::string const &  sceneName,
GameScene newScene 
)

Loads in a scene file and stores it in the game application.

Parameters
sceneNameA string that is used to refer back to the scene.
newSceneA pointer to a GameScene object that should be loaded into the scene buffer.

◆ run()

int rune::GameApplication::run ( void  )

Starts the main game loop.

Returns
The generated error code

Member Data Documentation

◆ m_errorCode

int rune::GameApplication::m_errorCode

A code that will be returned when the application closes that says what happened if execution failed.
0 = Execution concluded successfully.
1 = A rune::GameScene had not been loaded into the application at run time.


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