2014-12-15 16:47:30 +01:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: GameState.hpp
|
|
|
|
*
|
2018-06-05 01:24:54 +02:00
|
|
|
* Description:
|
2014-12-15 16:47:30 +01:00
|
|
|
*
|
|
|
|
* Created: 15/12/2014 03:51:32
|
|
|
|
*
|
2018-06-12 09:24:43 +02:00
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
2014-12-15 16:47:30 +01:00
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef GAMESTATE_HPP_
|
|
|
|
#define GAMESTATE_HPP_
|
|
|
|
|
2014-12-18 07:02:48 +01:00
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
2018-12-29 02:23:23 +01:00
|
|
|
#include <gk/core/ApplicationState.hpp>
|
|
|
|
#include <gk/gl/RenderTarget.hpp>
|
|
|
|
|
2018-12-30 04:32:29 +01:00
|
|
|
#include "Config.hpp"
|
2018-07-06 14:24:49 +02:00
|
|
|
#include "HUD.hpp"
|
2018-06-27 05:09:30 +02:00
|
|
|
#include "Player.hpp"
|
2014-12-26 00:39:10 +01:00
|
|
|
#include "Skybox.hpp"
|
2014-12-18 07:02:48 +01:00
|
|
|
#include "World.hpp"
|
2014-12-15 16:47:30 +01:00
|
|
|
|
2018-12-29 02:23:23 +01:00
|
|
|
class GameState : public gk::ApplicationState {
|
2014-12-15 16:47:30 +01:00
|
|
|
public:
|
|
|
|
GameState();
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-12-28 06:19:40 +01:00
|
|
|
void onEvent(const SDL_Event &event) override;
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-06-14 02:38:02 +02:00
|
|
|
void update() override;
|
|
|
|
|
2014-12-15 16:47:30 +01:00
|
|
|
private:
|
2018-06-25 14:04:25 +02:00
|
|
|
void initShaders();
|
|
|
|
|
2018-12-29 02:23:23 +01:00
|
|
|
void draw(gk::RenderTarget &target, gk::RenderStates states) const override;
|
2018-06-14 23:36:01 +02:00
|
|
|
|
2018-12-29 02:23:23 +01:00
|
|
|
gk::Shader m_shader;
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2014-12-26 00:39:10 +01:00
|
|
|
Skybox m_skybox;
|
2014-12-18 07:02:48 +01:00
|
|
|
World m_world;
|
2018-06-13 21:48:35 +02:00
|
|
|
|
2018-12-30 04:43:57 +01:00
|
|
|
gk::Camera m_camera{FOV, DIST_NEAR, DIST_FAR};
|
2018-12-30 04:32:29 +01:00
|
|
|
Player m_player{m_camera};
|
2018-06-27 05:09:30 +02:00
|
|
|
|
2018-12-30 04:40:05 +01:00
|
|
|
HUD m_hud{m_player, m_world};
|
2014-12-15 16:47:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GAMESTATE_HPP_
|