Wasabi
|
#include <WCore.hpp>
Public Member Functions | |
WGameState (Wasabi *const a) | |
virtual void | Load () |
virtual void | Update (float fDeltaTime) |
virtual void | OnKeyDown (char c) |
virtual void | OnKeyUp (char c) |
virtual void | OnMouseDown (W_MOUSEBUTTON button, double mx, double my) |
virtual void | OnMouseUp (W_MOUSEBUTTON button, double mx, double my) |
virtual void | OnMouseMove (double mx, double my) |
virtual void | OnInput (char c) |
virtual void | Cleanup () |
Protected Attributes | |
Wasabi *const | m_app |
This class represents a game state. Game states can be used to completely separate different phases of a game. For example, one can crate a game state for the pre-menu credits, a state for the game menu and a state for the actual game.
States need to be allocated and freed by the user.
|
inlinevirtual |
This function is called before this state is switched from. This gives the state a chance to clean up its resources before its destroyed.
|
inlinevirtual |
This function, will be called every time this state is switched to. This gives the state a chance to load its resources.
|
inlinevirtual |
This function is called whenever character input is received while this state is active. Character input is supplied by the OS, and is best suitable for capturing input for things like text boxes.
c | [description] |
|
inlinevirtual |
This function is called whenever a key is pushed down while this state is active.
c | The pushed key |
|
inlinevirtual |
This function is called whenever a key is released while this state is active.
c | The released key |
|
inlinevirtual |
This function is called whenever a mouse-down is captured while this state is active.
button | Mouse button captured |
mx | Mouse X where the event happened |
my | Mouse Y where the event happened |
|
inlinevirtual |
This function is called whenever the mouse moves while this state is active.
mx | New mouse X |
my | New mouse Y |
|
inlinevirtual |
This function is called whenever a mouse-down is captured while this state is active.
button | Mouse button captured |
mx | Mouse X where the event happened |
my | Mouse Y where the event happened |
|
inlinevirtual |
This function is called every frame (right after Wasabi::Loop()) while the state is active.
fDeltaTime | The step time for this frame (roughly 1 / FPS) |