Loading include/GlApplication.hpp +16 Changes for include/GlApplication.hpp: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ #include "model/Player.hpp" #include "model/Spaceship.hpp" #define WIN_NOT_WIN_YET -1 #define WIN_PLAYER_1 1 #define WIN_PLAYER_2 2 #define WIN_DRAW 3 class RenderObject; class GlApplication : public Application { Loading Loading @@ -51,9 +56,13 @@ class GlApplication : public Application { void createEntities(); void renderFrame() override; void renderGameFrame(); void renderGameEndedFrame(); void renderGUI(); void update() override; void updateGame(); void updateGameEnded(); static void resize(GLFWwindow * window, int framebufferWidth, int framebufferHeight); static void keyCallback(GLFWwindow * window, int key, int scancode, int action, int mods); void continuousKey(float deltaTime); Loading @@ -61,6 +70,8 @@ class GlApplication : public Application { void processPlayer1Input(GLFWwindow *window, float deltaTime); void processPlayer2Input(GLFWwindow *window, float deltaTime); void resetGame(); private: bool drawBoundingBoxes; Loading @@ -81,6 +92,11 @@ class GlApplication : public Application { std::shared_ptr<Spaceship> m_spaceshipPlayer1; ///< Player 1 spaceship std::shared_ptr<Spaceship> m_spaceshipPlayer2; ///< Player 2 spaceship std::shared_ptr<GuiElement> win; std::shared_ptr<GuiElement> lose; std::shared_ptr<GuiElement> draw; int winner; Program guiProgram; }; include/GuiElement.hpp +1 −1 Changes for include/GuiElement.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class GuiElement { public: GuiElement(Program &program); GuiElement(Program &program, const std::string &texturePath); void setPosition(glm::vec2 position); void setDimension(glm::vec2 dimension); Loading meshes/draw.png +32.9 KiB Loading image diff... meshes/lose.png +36.8 KiB Loading image diff... meshes/lose.xcf +79.1 KiB File added.No diff preview for this file type. View file Loading
include/GlApplication.hpp +16 Changes for include/GlApplication.hpp: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ #include "model/Player.hpp" #include "model/Spaceship.hpp" #define WIN_NOT_WIN_YET -1 #define WIN_PLAYER_1 1 #define WIN_PLAYER_2 2 #define WIN_DRAW 3 class RenderObject; class GlApplication : public Application { Loading Loading @@ -51,9 +56,13 @@ class GlApplication : public Application { void createEntities(); void renderFrame() override; void renderGameFrame(); void renderGameEndedFrame(); void renderGUI(); void update() override; void updateGame(); void updateGameEnded(); static void resize(GLFWwindow * window, int framebufferWidth, int framebufferHeight); static void keyCallback(GLFWwindow * window, int key, int scancode, int action, int mods); void continuousKey(float deltaTime); Loading @@ -61,6 +70,8 @@ class GlApplication : public Application { void processPlayer1Input(GLFWwindow *window, float deltaTime); void processPlayer2Input(GLFWwindow *window, float deltaTime); void resetGame(); private: bool drawBoundingBoxes; Loading @@ -81,6 +92,11 @@ class GlApplication : public Application { std::shared_ptr<Spaceship> m_spaceshipPlayer1; ///< Player 1 spaceship std::shared_ptr<Spaceship> m_spaceshipPlayer2; ///< Player 2 spaceship std::shared_ptr<GuiElement> win; std::shared_ptr<GuiElement> lose; std::shared_ptr<GuiElement> draw; int winner; Program guiProgram; };
include/GuiElement.hpp +1 −1 Changes for include/GuiElement.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class GuiElement { public: GuiElement(Program &program); GuiElement(Program &program, const std::string &texturePath); void setPosition(glm::vec2 position); void setDimension(glm::vec2 dimension); Loading