Skip to content

Instantly share code, notes, and snippets.

@awilki01
Last active May 11, 2024 16:41
Show Gist options
  • Save awilki01/776e360834f768b5693fcbbeb471cfda to your computer and use it in GitHub Desktop.
Save awilki01/776e360834f768b5693fcbbeb471cfda to your computer and use it in GitHub Desktop.
Rectangle.hpp
#ifndef RECTANGLE_H
#define RECTANGLE_H
#include <vector>
#include "Shader.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Vector3D.hpp"
class Rectangle
{
public:
Rectangle();
~Rectangle();
void draw(const Shader& shader);
void scale(const Shader& shader, glm::vec3& vFactor);
void translate(const Shader& shader, glm::vec3& vTranslate);
private:
float mVertices[12] {};
unsigned int mIndices[6] {};
unsigned int mVBO, mVAO, mEBO;
glm::mat4 mModel;
};
#endif //RECTANGLE_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment