From 07cc872b053c3d910a1f5b917e5d427236074732 Mon Sep 17 00:00:00 2001 From: itqop Date: Wed, 15 May 2024 13:35:20 +0300 Subject: [PATCH] Small fix --- include/game.h | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/include/game.h b/include/game.h index b0da9ef..2783d9f 100644 --- a/include/game.h +++ b/include/game.h @@ -2,7 +2,12 @@ #include "gl2d/gl2d.h" #include +#include "shader.h" +#include "camera.h" #include "glm/vec2.hpp" +#include +#include "renderer.h" +#include "skyBox.h" class GameInput @@ -46,9 +51,9 @@ public: } }; - enum keys + enum keys { - FRONT, + FRONT, BACK, LEFT, RIGHT, @@ -63,7 +68,7 @@ public: Button getKey(int k) const { - if (k < 0 || k >= BUTTONS_COUNT) + if(k < 0 || k >= BUTTONS_COUNT) { return Button{}; } @@ -71,7 +76,7 @@ public: return buttons[k]; } - void setKeyPress(int k) + void setKeyPress(int k) { if (k < 0 || k >= BUTTONS_COUNT) { @@ -94,7 +99,7 @@ public: void resetInputsThisFrame() { - for (int i = 0; i < BUTTONS_COUNT; i++) + for(int i=0; i< BUTTONS_COUNT; i++) { buttons[i].resetInput(); } @@ -138,14 +143,15 @@ private: }; + class Game { public: - + Game(int screenW, int screenH) { onCreate(screenW, screenH); } ~Game() { onDestroy(); } - void onUpdate(float deltaTime, const GameInput& input); + void onUpdate(float deltaTime, const GameInput &input); void updateWindowMetrics(int screenW, int screenH); @@ -160,5 +166,15 @@ private: gl2d::Font font; int screenW, screenH; + Camera *camera = 0; + bool isCreativeCamera = 0; + + ChunksRenderer renderer; + + ChunkManager chunkManager; + + gl2d::Texture arrowTexture; + + SkyBox skyBox; }; \ No newline at end of file