OpenMiner/include/states/GameState.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

57 lines
1.1 KiB
C++

/*
* =====================================================================================
*
* Filename: GameState.hpp
*
* Description:
*
* Created: 15/12/2014 03:51:32
*
* Author: Quentin Bazin, <quent42340@gmail.com>
*
* =====================================================================================
*/
#ifndef GAMESTATE_HPP_
#define GAMESTATE_HPP_
#include <glm/glm.hpp>
#include "ApplicationState.hpp"
#include "Camera.hpp"
#include "HUD.hpp"
#include "Player.hpp"
#include "Skybox.hpp"
#include "World.hpp"
#include "RenderTarget.hpp"
class GameState : public ApplicationState {
public:
GameState();
void onEvent(const sf::Event &event) override;
void update() override;
private:
void initShaders();
void draw(RenderTarget &target, RenderStates states) const override;
glm::mat4 m_projectionMatrix;
glm::mat4 m_viewMatrix;
Camera &m_camera{Camera::getInstance()};
Shader m_shader;
Skybox m_skybox;
World m_world;
Player m_player;
HUD m_hud{m_camera, m_player, m_world, m_viewMatrix, m_projectionMatrix};
};
#endif // GAMESTATE_HPP_