-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewCube.h
39 lines (29 loc) · 885 Bytes
/
newCube.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef M_CUBE
#define M_CUBE
#include "Shader.hh"
#include "glm/glm.hpp"
class newCube
{
private:
unsigned int VBO, VAO; //declara o VBO e VAO
unsigned int texture; //declara a textura
Shader myShader; //declara o Shader
//mat4 q serão usados para passar para o shader
glm::mat4 model;
glm::mat4 view;
glm::mat4 projection;
public:
newCube(); //construtor
~newCube(); //desconstrutor
void setTexture(const char* path); //recebe o caminho da textura
void setModel(glm::mat4 modelObj); //recebe model por paramentro
void bind();
void draw(unsigned int width, unsigned int height, glm::vec3 cameraPos, glm::vec3 cameraFront, glm::vec3 cameraUp); //desenha o cubo
void clear(); // limpa o VAO e a textura
void closeBind();
private:
void bindTexture();
void bindVertex();
void createCube(); //cria o cubo
};
#endif