OpenMiner/include/states/ApplicationState.hpp
exilief dc8d781393 Switching from SDL to SFML (#14)
* Add SFML support besides SDL. Choose with global macro USE_SDL / USE_SFML.

+ Small fixes to make it compile on MinGW (with Glad instead of GLEW -> option NO_GLEW)

* Add SFML support besides SDL (Part 3). Cleaned up some macros.

* Add SFML support besides SDL (Part 4). Small SFML fixes. Changed Spaces->Tabs

* Add SFML support besides SDL (Part 5). Cleaning up more macros + small fixes.

* Port to SFML. Removed all SDL code.

* Small changes

* Conversion functions to/from SFML types for Vector2/3 and Color.

* Removed unused SDL files

* Changes for SFML port

* Changes for SFML port

* Fixed line endings (probably?)
2018-12-26 18:36:46 +01:00

47 lines
1.2 KiB
C++

/*
* =====================================================================================
*
* Filename: ApplicationState.hpp
*
* Description:
*
* Created: 05/06/2018 15:45:26
*
* Author: Quentin Bazin, <quent42340@gmail.com>
*
* =====================================================================================
*/
#ifndef APPLICATIONSTATE_HPP_
#define APPLICATIONSTATE_HPP_
#include <SFML/Window/Event.hpp>
#include "IDrawable.hpp"
#include "Transformable.hpp"
class ApplicationStateStack;
class ApplicationState : public IDrawable, public Transformable {
public:
ApplicationState(ApplicationState *parent = nullptr) : m_parent(parent) {}
ApplicationState(const ApplicationState &) = delete;
ApplicationState(ApplicationState &&) = default;
virtual ~ApplicationState() = default;
ApplicationState &operator=(const ApplicationState &) = delete;
ApplicationState &operator=(ApplicationState &&) = default;
virtual void onEvent(const sf::Event &) {}
virtual void update() = 0;
void setStateStack(ApplicationStateStack *stateStack) { m_stateStack = stateStack; }
protected:
ApplicationState *m_parent = nullptr;
ApplicationStateStack *m_stateStack = nullptr;
};
#endif // APPLICATIONSTATE_HPP_