Manages several GameWorld. Responsible for assembling them and passing along Staged events as well as user input events.
More...
#include <app.h>
|
| App () |
|
virtual | ~App () |
|
void | update (float deltaTime, float time) |
| This invokes the Update stages of any world, or the Start stage if this is the world's first frame.
|
|
void | fixedUpdate (float deltaTime, float time) |
| This invokes the FixedUpdate stages of any world, if that world has been started. Fixed updates should run at a stable frame rate, and is a good place to put physics-based Systems.
|
|
void | draw () |
| Invoke the Draw stage of any managed World.
|
|
void | keyEvent (int key, int action) |
| Invoke a keyboard event.
|
|
void | mousePosEvent (double xpos, double ypos) |
| Invoke a mouse position event. This happens whenever the mouse changes position.
|
|
void | mouseButtonEvent (int button, int action) |
| Invoke a mouse button event.
|
|
void | scrollEvent (double distance) |
| Invoke a scroll event, that happens when the user scroll with the mouse.
|
|
void | framebufferResizeEvent (int width, int height) |
| Invoked whenever the framebuffer needs to be resized.
|
|
void | windowResizeEvent (int width, int height) |
| Invoked whenever the user resize the window.
|
|
std::shared_ptr< GameWorld > | createGameWorld () |
| Create a Game World object.
|
|
void | removeGameWorld (std::shared_ptr< GameWorld > world) |
| Remove a GameWorld.
|
|
Manages several GameWorld. Responsible for assembling them and passing along Staged events as well as user input events.
◆ App()
◆ ~App()
◆ createGameWorld()
std::shared_ptr< GameWorld > Saga::App::createGameWorld |
( |
| ) |
|
Create a Game World object.
- Returns
- std::shared_ptr<GameWorld>
◆ draw()
Invoke the Draw stage of any managed World.
◆ fixedUpdate()
void Saga::App::fixedUpdate |
( |
float |
deltaTime, |
|
|
float |
time |
|
) |
| |
This invokes the FixedUpdate stages of any world, if that world has been started. Fixed updates should run at a stable frame rate, and is a good place to put physics-based Systems.
- Parameters
-
deltaTime | time since the last fixed update. |
time | time ellapsed since the start of the Application. |
◆ framebufferResizeEvent()
void Saga::App::framebufferResizeEvent |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
Invoked whenever the framebuffer needs to be resized.
- Parameters
-
width | the width in pixels of the new framebuffer. |
height | the height in pixels of the new framebuffer. |
◆ keyEvent()
void Saga::App::keyEvent |
( |
int |
key, |
|
|
int |
action |
|
) |
| |
Invoke a keyboard event.
- Parameters
-
key | a GLFW key enum. |
action | a GLFW action on that key. |
◆ mouseButtonEvent()
void Saga::App::mouseButtonEvent |
( |
int |
button, |
|
|
int |
action |
|
) |
| |
Invoke a mouse button event.
- Parameters
-
key | a GLFW key enum. |
action | a GLFW action on that mouse button. |
◆ mousePosEvent()
void Saga::App::mousePosEvent |
( |
double |
xpos, |
|
|
double |
ypos |
|
) |
| |
Invoke a mouse position event. This happens whenever the mouse changes position.
- Parameters
-
xpos | the x position of the mouse in screen space. |
ypos | the y position of the mouse in screen space. |
◆ removeGameWorld()
void Saga::App::removeGameWorld |
( |
std::shared_ptr< GameWorld > |
world | ) |
|
◆ scrollEvent()
void Saga::App::scrollEvent |
( |
double |
distance | ) |
|
Invoke a scroll event, that happens when the user scroll with the mouse.
- Parameters
-
distance | the distance in pixel of the scroll. |
◆ update()
void Saga::App::update |
( |
float |
deltaTime, |
|
|
float |
time |
|
) |
| |
This invokes the Update stages of any world, or the Start stage if this is the world's first frame.
- Parameters
-
deltaTime | time since the last update. |
time | time ellapsed since the start of the Application. |
◆ windowResizeEvent()
void Saga::App::windowResizeEvent |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
Invoked whenever the user resize the window.
- Parameters
-
width | the width of the new window in pixels. |
height | the height of the new window in pixels. |
The documentation for this class was generated from the following files: