15 class Shader :
protected QOpenGLFunctions {
19 initializeOpenGLFunctions();
22 lineShader.addShaderFromSourceFile(QOpenGLShader::Vertex,
"../assets/shaders/vertex.vert");
23 lineShader.addShaderFromSourceFile(QOpenGLShader::Fragment,
"../assets/shaders/fragment_line.frag");
24 glBindAttribLocation(
lineShader.programId(), 0,
"aPos");
25 glBindAttribLocation(
lineShader.programId(), 1,
"aColor");
28 normalShader.addShaderFromSourceFile(QOpenGLShader::Vertex,
"../assets/shaders/vertex.vert");
29 normalShader.addShaderFromSourceFile(QOpenGLShader::Fragment,
"../assets/shaders/fragment.frag");
30 glBindAttribLocation(
normalShader.programId(), 0,
"aPos");
31 glBindAttribLocation(
normalShader.programId(), 1,
"aColor");
34 bezierShader.addShaderFromSourceFile(QOpenGLShader::Vertex,
"../assets/shaders/vertex.vert");
35 bezierShader.addShaderFromSourceFile(QOpenGLShader::TessellationControl,
"../assets/shaders/tcs.txt");
36 bezierShader.addShaderFromSourceFile(QOpenGLShader::TessellationEvaluation,
"../assets/shaders/tes.txt");
37 bezierShader.addShaderFromSourceFile(QOpenGLShader::Fragment,
"../assets/shaders/fragment.frag");
39 glBindAttribLocation(
bezierShader.programId(), 0,
"aPos");
40 glBindAttribLocation(
bezierShader.programId(), 1,
"aColor");
A shader.
Definition: Shader.h:15
Shader()
Definition: Shader.h:18
QOpenGLShaderProgram normalShader
Definition: Shader.h:50
QOpenGLShaderProgram lineShader
Definition: Shader.h:53
QOpenGLShaderProgram bezierShader
Definition: Shader.h:54
~Shader()
Definition: Shader.h:43