ChessPlusPlus  WIP
cplusplus.com Community Project
chesspp::app::AppState Class Referenceabstract

Base class for application states. More...

#include <AppState.hpp>

Inheritance diagram for chesspp::app::AppState:
chesspp::SfmlEventHandler chesspp::app::ChessPlusPlusState chesspp::app::StartMenuState

Public Member Functions

 AppState (sf::RenderWindow &disp)
 Construct bound to an sf::RenderWindow. More...
 
virtual void onRender ()=0
 Called to render the current state. More...
 
- Public Member Functions inherited from chesspp::SfmlEventHandler
virtual void onClosed ()
 
virtual void onResized (uint w, uint h)
 
virtual void onLostFocus ()
 
virtual void onGainedFocus ()
 
virtual void onTextEntered (sf::Uint32 unicode)
 
virtual void onKeyPressed (sf::Keyboard::Key key, bool alt, bool control, bool shift, bool system)
 
virtual void onKeyReleased (sf::Keyboard::Key key, bool alt, bool control, bool shift, bool system)
 
virtual void onMouseWheelMoved (int delta, int x, int y)
 
virtual void onLButtonPressed (int x, int y)
 
virtual void onLButtonReleased (int x, int y)
 
virtual void onRButtonPressed (int x, int y)
 
virtual void onRButtonReleased (int x, int y)
 
virtual void onMButtonPressed (int x, int y)
 
virtual void onMButtonReleased (int x, int y)
 
virtual void onMouseButtonPressed (sf::Mouse::Button button, int x, int y)
 
virtual void onMouseButtonReleased (sf::Mouse::Button button, int x, int y)
 
virtual void onMouseMoved (int x, int y)
 
virtual void onMouseEnteredWindow ()
 
virtual void onMouseLeftWindow ()
 
virtual void onJoystickButtonPressed (uint joystickID, uint button)
 
virtual void onJoystickButtonReleased (uint joystickID, uint button)
 
virtual void onJoystickMoved (uint joystickID, sf::Joystick::Axis axis, float position)
 
virtual void onJoystickConnected (uint joystickID)
 
virtual void onJoystickDisconnected (uint joystickID)
 
virtual ~SfmlEventHandler ()=default
 

Protected Attributes

sf::RenderWindow & display
 The sf::RenderWindow bound at construction. More...
 

Additional Inherited Members

- Public Types inherited from chesspp::SfmlEventHandler
using uint = unsigned int
 

Detailed Description

Base class for application states.

See also, chesspp::app::Application

Constructor & Destructor Documentation

chesspp::app::AppState::AppState ( sf::RenderWindow &  disp)
inline

Construct bound to an sf::RenderWindow.

Parameters
dispThe sf::RenderWindow which must outlive this object.

Member Function Documentation

virtual void chesspp::app::AppState::onRender ( )
pure virtual

Called to render the current state.

Rendering should be done to the protected display member variable.

Implemented in chesspp::app::ChessPlusPlusState, and chesspp::app::StartMenuState.

Member Data Documentation

sf::RenderWindow& chesspp::app::AppState::display
protected

The sf::RenderWindow bound at construction.


The documentation for this class was generated from the following file: