CG-Project2
|
This class allow to create a state to be attached to the StateManager. A State works like a scene: defines all the meshes that will be rendered or not, defines custom behaviour while updating mesh data or while rendering meshes. More...
#include <State.hpp>
Public Member Functions | |
virtual void | onAttach () |
This method is called after using StateManager::sync() (read StateMnaager::sync() documentation for more info). It should contain all the operations that must be done before you start the execution of a State. | |
virtual void | onDetach () |
This method is called while using sync() (read sync() documentation for more info). It should contain all the operations that must be done at the end of State execution before deleting or changing State, it is automatically called by sync(). | |
virtual void | onUpdate () |
This methods contains all the operations executed at every event::loop::LOOP_UPDATE if there are any. | |
virtual void | onRender () |
This methods contains all the operations executed at every event::loop::LOOP_RENDER if there are any. | |
virtual bool | isCurrentStateEnd () |
Retrieves the current binary state of the current State | |
std::string | getName () const |
Retrieves the State name. | |
bool | isAttached () const |
Retrieves if the state is attached. | |
State (const std::string &name="State") | |
Instances a state with the given name. |
Protected Attributes | |
const std::string | m_name |
state's name | |
bool | m_attached = false |
true if the state is attached |
This class allow to create a state to be attached to the StateManager. A State works like a scene: defines all the meshes that will be rendered or not, defines custom behaviour while updating mesh data or while rendering meshes.
This is an abstract class it needs to be extended and override the methods that the child State will use.
It can be used to create scenes with meshes, lights, skybox etc. A State can have custom behaviour while updating and rendering, every "static" mesh must be initialized in State::onAttach() implementation.
|
inline |
Instances a state with the given name.
@params name the state's name
|
inline |
Retrieves the State name.
|
inline |
Retrieves if the state is attached.
|
inlinevirtual |
Retrieves the current binary state of the current State
Reimplemented in BootstrapState, and NormalViewState.
|
inlinevirtual |
This method is called after using StateManager::sync() (read StateMnaager::sync() documentation for more info). It should contain all the operations that must be done before you start the execution of a State.
Also this method need to be called in child class implementation using State::onAttach()
Reimplemented in BootstrapState, and NormalViewState.
|
inlinevirtual |
This method is called while using sync() (read sync() documentation for more info). It should contain all the operations that must be done at the end of State execution before deleting or changing State, it is automatically called by sync().
Also this method need to be called in child class implementation using State::onDetach()
Reimplemented in BootstrapState, and NormalViewState.
|
inlinevirtual |
This methods contains all the operations executed at every event::loop::LOOP_RENDER if there are any.
Reimplemented in BootstrapState, and NormalViewState.
|
inlinevirtual |
This methods contains all the operations executed at every event::loop::LOOP_UPDATE if there are any.
Reimplemented in BootstrapState, and NormalViewState.