#pragma once #include #include #include #include #include "../../renderable.h" #include "../../vertex.h" #include "../../gfx/vbo.h" #include "../../gfx/vao.h" #include "../../gfx/shader.h" #include "../../gfx/texture.h" #include "../../optional.h" #include namespace simpleengine::shapes_2d { class Triangle : public simpleengine::Renderable { private: using super = simpleengine::Renderable; private: gfx::Shader shader; // This only stores the shader program nonstd::optional texture; public: std::vector vertices; gfx::VBO vbo; gfx::VAO vao; Triangle(gfx::Shader shader, std::vector vertices); Triangle(std::shared_ptr shader_program, std::vector vertices); virtual ~Triangle() = default; void set_texture(gfx::Texture texture); virtual void update(const float& delta_time) override; virtual void render(std::shared_ptr target) override; }; }