Used for starting up and shutting down the Gel2D game engine. More...
#include <gelEngine.h>
Static Public Member Functions | |
static void | start () |
Starts the Gel2D game engine. | |
static int | shutdown () |
Shuts down the Gel2D game engine. | |
static GelRenderSystem * | getRenderSystem () |
Gets the active render system. | |
static void | setRenderAPI (RenderAPI api) |
Sets the graphics API to use for rendering. | |
static RenderAPI | getRenderAPI () |
Gets the graphics API used for rendering. | |
static void | setFrameFunc (GelCallbackB func) |
Sets the frame function that will be called in the game loop. | |
static void | setDrawFunc (GelCallback func) |
Sets the draw function that will be called in the game loop. | |
static void | setFPS (int _fps) |
Sets the frame rate. | |
static int | getFPS () |
Gets the frame rate. | |
static bool | startLoop () |
Starts the game loop. | |
static bool | log (const char *message,...) |
Writes a string to a log file and the standard output (stdout). | |
static void | setLogFilename (const char *filename) |
Sets the name of the log file. |
Used for starting up and shutting down the Gel2D game engine.
This class is used for initializing the engine, which must be done before any other features of the engine are used. I have tried to keep every class as independent of each other as possible; so in reality, you may be able to use many classes/functions of the engine without calling start(), but it inevitably must be called at some point, so you might as well do it at the beginning of your program to avoid problems.
static void gel::GelEngine::start | ( | ) | [static] |
Starts the Gel2D game engine.
This must be called at the beginning of your program.
static int gel::GelEngine::shutdown | ( | ) | [static] |
Shuts down the Gel2D game engine.
This must be called at the end of your program.
static GelRenderSystem* gel::GelEngine::getRenderSystem | ( | ) | [inline, static] |
Gets the active render system.
static void gel::GelEngine::setRenderAPI | ( | RenderAPI | api | ) | [static] |
Sets the graphics API to use for rendering.
The API can only be set before calling start().
Gel2D uses the OpenGL API by default.
OpenGL is the only renderer supported for now.
api | : The API to use for rendering. |
static RenderAPI gel::GelEngine::getRenderAPI | ( | ) | [inline, static] |
Gets the graphics API used for rendering.
OpenGL is the only renderer supported for now.
static void gel::GelEngine::setFrameFunc | ( | GelCallbackB | func | ) | [inline, static] |
Sets 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.
func | : Pointer to a user-defined frame function. |
static void gel::GelEngine::setDrawFunc | ( | GelCallback | func | ) | [inline, static] |
Sets the draw function that will be called in the game loop.
The function must take no parameters and return void.
All rendering code should go here.
func | : Pointer to a user-defined draw function. |
static void gel::GelEngine::setFPS | ( | int | _fps | ) | [inline, static] |
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. |
static int gel::GelEngine::getFPS | ( | ) | [inline, static] |
Gets the frame rate.
static bool gel::GelEngine::startLoop | ( | ) | [static] |
Starts the game loop.
This function calls the frame and render functions, then polls for events.
static bool gel::GelEngine::log | ( | const char * | message, |
... | |||
) | [static] |
Writes a string to a log file and the standard output (stdout).
message | : The string to be written. |
... | : Optional arguments list. |
static void gel::GelEngine::setLogFilename | ( | const char * | filename | ) | [inline, static] |
Sets the name of the log file.
filename | : The name of the log file. |
API Documentation by Mark D. Procarione | Generated by |