GameKit
0.0.1a
C++ gamedev tools
|
Base class for your own Application. More...
#include <CoreApplication.hpp>
Public Member Functions | |
CoreApplication (int argc, char **argv) | |
Constructor. More... | |
int | run (bool isProtected=true) |
Run the application. More... | |
Protected Member Functions | |
virtual void | init () |
Initialization function. More... | |
void | createWindow (u16 screenWidth, u16 screenHeight, const char *windowTitle) |
Open window. More... | |
virtual void | onEvent (const SDL_Event &event) |
This function is called when a new window event is received. More... | |
virtual void | handleEvents () |
Poll window events and send them to onEvent() and ApplicationStateStack. More... | |
virtual void | mainLoop () |
Game main loop, automatically called by run() More... | |
Protected Attributes | |
SDLLoader | m_sdlLoader |
Init and free SDL. More... | |
bool | m_loadSDL = true |
If this flag is set to false, SDL won't be loaded. More... | |
ApplicationStateStack | m_stateStack |
Stack containing application states. More... | |
GameClock | m_clock |
Simulated time system. More... | |
ResourceHandler | m_resourceHandler |
Container for all game resources. More... | |
Window | m_window |
The main window. More... | |
RenderStates | m_renderStates = RenderStates::Default |
The default render states. More... | |
ArgumentParser | m_argumentParser |
Helper for argument management. More... | |
Base class for your own Application.
This class provides an interface to create your own application.
You should add a class named Application
that inherits from this class.
Definition at line 30 of file CoreApplication.hpp.
gk::CoreApplication::CoreApplication | ( | int | argc, |
char ** | argv | ||
) |
Constructor.
Definition at line 23 of file CoreApplication.cpp.
|
protected |
Open window.
Opens a new window with defined size and title.
Definition at line 74 of file CoreApplication.cpp.
|
protectedvirtual |
Poll window events and send them to onEvent() and ApplicationStateStack.
This function is automatically called by mainLoop()
Definition at line 84 of file CoreApplication.cpp.
|
protectedvirtual |
Initialization function.
This function is used to init engine and singletons.
Definition at line 26 of file CoreApplication.cpp.
|
protectedvirtual |
Game main loop, automatically called by run()
Definition at line 94 of file CoreApplication.cpp.
|
protectedvirtual |
This function is called when a new window event is received.
event | Event received from SDL |
This function is automatically called by handleEvents()
Definition at line 78 of file CoreApplication.cpp.
int gk::CoreApplication::run | ( | bool | isProtected = true | ) |
Run the application.
isProtected | Exceptions are catched if this parameter is set to true (default) |
Loads SDL libraries, run init(), then mainLoop()
Definition at line 41 of file CoreApplication.cpp.
|
protected |
Helper for argument management.
Definition at line 112 of file CoreApplication.hpp.
|
protected |
Simulated time system.
Definition at line 104 of file CoreApplication.hpp.
|
protected |
If this flag is set to false, SDL won't be loaded.
Definition at line 100 of file CoreApplication.hpp.
|
protected |
The default render states.
Definition at line 110 of file CoreApplication.hpp.
|
protected |
Container for all game resources.
Definition at line 106 of file CoreApplication.hpp.
|
protected |
Init and free SDL.
Definition at line 99 of file CoreApplication.hpp.
|
protected |
Stack containing application states.
Definition at line 102 of file CoreApplication.hpp.
|
protected |
The main window.
Definition at line 108 of file CoreApplication.hpp.