Commit 3448895c authored by Benjamin Castel's avatar Benjamin Castel
Browse files

meta: handled conflicts in the report redaction

parents c319169f 2b2dd2a7
Loading
Loading
Loading
Loading
+1 −1
Changes for CMakeLists.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -18,5 +18,5 @@ include_directories("glitter/ext/tinyobjloader"
		${OPENGL_INCLUDE_DIR})

add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/GuiElement.cpp src/RenderObjectPart.cpp src/GlApplication.cpp
               src/model/Spaceship.cpp src/model/Asteroid.cpp src/model/Entity.cpp src/model/Missile.cpp)
               src/model/Spaceship.cpp src/model/Asteroid.cpp src/model/LifeGui.cpp src/model/Entity.cpp src/model/Missile.cpp)
target_link_libraries(GLE-test utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
+19 −0
Changes for include/GlApplication.hpp: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,10 +18,16 @@
#include "GuiElement.hpp"
#include "RenderObject.hpp"
#include "model/Asteroid.hpp"
#include "model/LifeGui.hpp"
#include "model/Missile.hpp"
#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 {
@@ -51,9 +57,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);
@@ -61,6 +71,8 @@ class GlApplication : public Application {

        void processPlayer1Input(GLFWwindow *window, float deltaTime);
        void processPlayer2Input(GLFWwindow *window, float deltaTime);

        void resetGame();
    private:
        bool drawBoundingBoxes;

@@ -81,6 +93,13 @@ 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;

        std::shared_ptr<LifeGui> healthbar;

        int winner;

        Program guiProgram;
};
+7 −1
Changes for include/GuiElement.hpp: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -15,15 +15,21 @@ class GuiElement {
		glm::vec2 dimension;

		Sampler textureSampler;
		Texture texture;
		std::shared_ptr<Texture> texture;
		VAO vao;

		glm::mat4 modelMatrix;

		void computeModelMatrix();

		void createElement(Program &program);

	protected:
		void setTexture(std::shared_ptr<Texture> &newTexture);

	public: 

		GuiElement(Program &program, const std::string &texturePath);
		GuiElement(Program &program);

		void setPosition(glm::vec2 position);
+18 −0
Changes for include/model/LifeGui.hpp: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
#pragma once

#include <glApi.hpp>

#include "GuiElement.hpp"

class LifeGui : public GuiElement {
	public:

		LifeGui(Program &program);

		void setCurrentLife(const unsigned int &life);

	private:
		std::shared_ptr<Texture> hp_3_texture;
		std::shared_ptr<Texture> hp_2_texture;
		std::shared_ptr<Texture> hp_1_texture;
};
 No newline at end of file

meshes/draw.png

0 → 100644
+32.9 KiB
Loading image diff...
Loading