Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
fireworks::Fireworks Class Referenceabstract

The Game class to use the Fireworks Engine. More...

#include <fireworks.h>

Public Member Functions

void start ()
 A function that starts the main game loop. More...
 

Protected Member Functions

 Fireworks ()
 
virtual ~Fireworks ()
 
graphics::WindowcreateWindow (const char *name, int width, int height)
 A function to create the Main Window. More...
 
virtual void init ()=0
 Runs once per initialization. More...
 
virtual void tick ()
 Runs once per second. More...
 
virtual void update ()
 Runs 60 times per second. More...
 
virtual void render ()=0
 Runs as fast as possible. More...
 
const unsigned int getFPS ()
 A function to get the current FPS : Frames per second . More...
 
const unsigned int getUPS ()
 A function to get the current UPS : Updates per second . More...
 

Detailed Description

The Game class to use the Fireworks Engine.

It is the main class from which the game class must be derived from to use the fireworks engine

Constructor & Destructor Documentation

◆ Fireworks()

fireworks::Fireworks::Fireworks ( )
inlineprotected

◆ ~Fireworks()

virtual fireworks::Fireworks::~Fireworks ( )
inlineprotectedvirtual

Member Function Documentation

◆ createWindow()

graphics::Window* fireworks::Fireworks::createWindow ( const char *  name,
int  width,
int  height 
)
inlineprotected

A function to create the Main Window.

Parameters
nameThe name of the window
widthThe width of the window
heightThe height of the window
Returns
An pointer object to the currently created of type graphics::Window Use this object to set properties of the window and control the input
See also
graphics::Window for more details on using/seeting the window properties

◆ getFPS()

const unsigned int fireworks::Fireworks::getFPS ( )
inlineprotected

A function to get the current FPS : Frames per second .

Returns
Returns the current FPS of type unsigned int

◆ getUPS()

const unsigned int fireworks::Fireworks::getUPS ( )
inlineprotected

A function to get the current UPS : Updates per second .

We usually want the number of updates to be around 60 per second

Returns
Returns the current UPS of type unsigned int

◆ init()

virtual void fireworks::Fireworks::init ( )
protectedpure virtual

Runs once per initialization.

◆ render()

virtual void fireworks::Fireworks::render ( )
protectedpure virtual

Runs as fast as possible.

◆ start()

void fireworks::Fireworks::start ( )
inline

A function that starts the main game loop.

Attention
The main class the derives from fireworks::Fireworks must use this method (in main.cpp) to start the game

◆ tick()

virtual void fireworks::Fireworks::tick ( )
inlineprotectedvirtual

Runs once per second.

◆ update()

virtual void fireworks::Fireworks::update ( )
inlineprotectedvirtual

Runs 60 times per second.


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