From 8f4eb04b2da9c2a6f25edfa56910c8f756adcee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Sun, 28 Dec 2025 18:32:56 +0100 Subject: [PATCH] feat(shape)!: redefine as base class for cube and other shapes --- inc/shape.hpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/inc/shape.hpp b/inc/shape.hpp index 14bdd00..0fc4eb6 100644 --- a/inc/shape.hpp +++ b/inc/shape.hpp @@ -1,31 +1,36 @@ #ifndef SHAPE_HPP #define SHAPE_HPP -#include - -#include - #include "camera.hpp" -#include "glm/fwd.hpp" +#include "ebo.hpp" +#include "glm/ext/vector_float3.hpp" +#include "shader.hpp" +#include "texture.hpp" +#include "vao.hpp" +#include "vbo.hpp" class Shape { - protected: - glm::vec3 position; - Camera& cameraRef; + private: + glm::vec3 pos; - virtual void init() = 0; + protected: + Camera &camera; + + VBO vbo; + EBO ebo; + VAO vao; + + Shader shader; + Texture texture; public: - Shape(Camera& cameraRef, glm::vec3 position) - : position(position), cameraRef(cameraRef) - { - } + Shape(Camera &camera, glm::vec3 pos, Shader shader, Texture texture); - glm::vec3 getPosition() const { return position; } - Camera& getCamera() const { return cameraRef; } + virtual void render(int width, int height) = 0; - virtual void render() = 0; + glm::vec3 getPosition() const { return pos; } + void setPosition(glm::vec3 &new_pos) { pos = new_pos; } }; #endif \ No newline at end of file