-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglmesh.h
43 lines (29 loc) · 791 Bytes
/
glmesh.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
40
41
42
43
#ifndef GLMESH_H
#define GLMESH_H
#include "mesh.h"
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLFunctions>
#include "shader.h"
#include "opencv2/opencv.hpp"
class GLMesh: public QOpenGLFunctions
{
public:
GLMesh();
GLMesh(Mesh& mesh);
GLMesh(const GLMesh& mesh);
GLMesh& operator=( const GLMesh& rhs );
const QVector<Vertex>& vertices() { return _vertices; }
const QVector<unsigned int>& indices() { return _indices; }
void draw(Shader &shader);
void createTexture(cv::Mat &img);
QMatrix4x4 modelMatrix;
private:
void setupMesh();
QOpenGLVertexArrayObject VAO;
QOpenGLBuffer VBO, EBO;
QVector<Vertex> _vertices;
QVector<unsigned int> _indices;
Texture texture;
};
#endif // GLMESH_H