-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.hpp
46 lines (32 loc) · 1.09 KB
/
Game.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "Mode.hpp"
#include "MeshBuffer.hpp"
#include "GL.hpp"
#include <SDL.h>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <vector>
// The 'Game' mode is the main gameplay mode:
struct Game : public Mode {
Game();
virtual ~Game();
//handle_event is called when new mouse or keyboard events are received:
// (note that this might be many times per frame or never)
//The function should return 'true' if it handled the event.
virtual bool handle_event(SDL_Event const &evt, glm::uvec2 const &window_size) override;
//update is called at the start of a new frame, after events are handled:
virtual void update(float elapsed) override;
//draw is called after update:
virtual void draw(glm::uvec2 const &drawable_size) override;
//------- game state -------
glm::uvec2 board_size = glm::uvec2(5,4);
std::vector< MeshBuffer::Mesh const * > board_meshes;
std::vector< glm::quat > board_rotations;
glm::uvec2 cursor = glm::vec2(0,0);
struct {
bool roll_left = false;
bool roll_right = false;
bool roll_up = false;
bool roll_down = false;
} controls;
};