-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcrender.h
More file actions
43 lines (41 loc) · 813 Bytes
/
crender.h
File metadata and controls
43 lines (41 loc) · 813 Bytes
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 CRENDER_H
#define CRENDER_H
#include <vector>
#include <QOpenGLFunctions_4_3_Core>
#include <QGLShader>
#include <QGLShaderProgram>
using namespace std;
typedef float SPFLOAT;
struct vector2f
{
SPFLOAT _x, _y;
};
struct vector3f
{
SPFLOAT _x, _y, _z;
};
struct vector4f
{
SPFLOAT _r, _g, _b, _a;
};
struct vector4b
{
GLubyte _r, _g, _b, _a;
};
class CRender :protected QOpenGLFunctions_4_3_Core
{
public:
CRender();
~CRender();
void prepare();
void bindShader();
virtual void bindAttributes();
void setBackGround(vector4f& _color);
void releaseShader();
QGLShaderProgram *getShader();
void initialShader();
protected:
QGLShaderProgram m_shaderprogram; //shader程序
vector<GLuint> m_vaos; //vba
};
#endif // CRENDER_H