Represents the application and holds the current AppState.
More...
#include <Application.hpp>
Represents the application and holds the current AppState.
chesspp::app::Application::Application |
( |
sf::RenderWindow & |
disp | ) |
|
|
inline |
Construct from an sf::RenderWindow.
Also calls sf::RenderWindow::setVerticalSyncEnabled(true)
.
- Parameters
-
disp | The sf::RenderWindow that will be drawn to. Must outlive this object. |
template<class NewState , typename... Args>
void chesspp::app::Application::changeState |
( |
Args &&... |
args | ) |
|
|
inline |
Changes the current AppState by constructing a new one in place and destructing the old one.
The old AppState instance is destructed within this function, so it must not be referenced anymore.
- Template Parameters
-
NewState | The type of AppState to construct. |
Args | deuced by the compiler from the parameter list. |
- Parameters
-
args | Arguments to pass to the constructor of NewState |
int chesspp::app::Application::execute |
( |
| ) |
|
Begins running the application via the current AppState.
This function blocks while the application is running. Application::stop() can be called to cause this function to return.
- Returns
- An appropriate return value for returning from main()
void chesspp::app::Application::stop |
( |
| ) |
|
|
noexcept |
The documentation for this class was generated from the following files: