SimpleEngine/include/simpleengine/objects/2d/shapes/square.h

52 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#ifdef __linux__
#include <GL/glew.h>
#include <GL/gl.h>
#elif
#include <gl/glew.h>
#include <gl/gl.h>
#endif
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
2021-12-07 03:54:22 +00:00
#include "../../../renderable.h"
#include "../../../vertex.h"
#include "../../../transformable.h"
#include "../../../optional.h"
2021-12-07 03:54:22 +00:00
#include "../../../gfx/vbo.h"
#include "../../../gfx/vao.h"
#include "../../../gfx/texture.h"
#include "../../../gfx/shader.h"
#include <stdint.h>
#include <vector>
2021-12-07 03:54:22 +00:00
namespace simpleengine::objects_2d::shapes {
2021-12-03 04:10:32 +00:00
class Square : public simpleengine::Renderable, public simpleengine::Transformable {
private:
gfx::Shader shader;
nonstd::optional<gfx::Texture> texture;
public:
2021-11-26 03:28:47 +00:00
std::vector<Vertex> vertices;
std::vector<GLuint> indicies;
gfx::VBO ebo;
gfx::VBO vbo;
gfx::VAO vao;
Square(gfx::Shader shader, std::vector<Vertex> vertices, std::vector<GLuint> indicies);
Square(std::shared_ptr<GLuint> shader_program, std::vector<Vertex> vertices, std::vector<GLuint> indicies);
virtual ~Square() = default;
void set_texture(gfx::Texture texture);
virtual void update(const float& delta_time) override;
virtual void render(GLFWwindow* target) override;
};
}