Reimplementable base class for your Gel2D application. More...
#include <gelAppBase.h>
Public Member Functions | |
GelAppBase () | |
Constructor. | |
virtual | ~GelAppBase () |
Destructor. | |
void | start () |
Starts the game loop. | |
Protected Member Functions | |
virtual bool | update () |
The frame function that will be called in the game loop. | |
virtual void | render () |
The draw function that will be called in the game loop. | |
virtual void | mainLoop () |
The game loop. | |
void | setFPS (int _fps) |
Sets the frame rate. | |
int | getFPS () |
Gets the frame rate. |
Reimplementable base class for your Gel2D application.
This class serves as an inheritable template for your app.
gel::GelAppBase::GelAppBase | ( | ) |
Constructor.
virtual gel::GelAppBase::~GelAppBase | ( | ) | [virtual] |
Destructor.
void gel::GelAppBase::start | ( | ) |
Starts the game loop.
This function will call mainloop().
virtual bool gel::GelAppBase::update | ( | ) | [protected, virtual] |
The frame function that will be called in the game loop.
The function must take no parameters and return bool.
This is the function you should put all of your game logic in.
To terminate the game loop, the function should return false, otherwise, it should return true.
virtual void gel::GelAppBase::render | ( | ) | [protected, virtual] |
The draw function that will be called in the game loop.
All rendering code should go here.
virtual void gel::GelAppBase::mainLoop | ( | ) | [protected, virtual] |
The game loop.
This function calls the frame and render functions, then polls for events.
You can reimplement this function as well, although it isn't necessary.
void gel::GelAppBase::setFPS | ( | int | _fps | ) | [inline, protected] |
Sets the frame rate.
By default, the fps is set to 60.
If you set the fps to 0, it will run unlimited.
_fps | : The new frame speed in seconds. |
int gel::GelAppBase::getFPS | ( | ) | [inline, protected] |
Gets the frame rate.
API Documentation by Mark D. Procarione | Generated by |