Parallel Coordinate System with Time Series Data
Shader.h
Go to the documentation of this file.
1 //#ifndef SHADER_H
2 //#define SHADER_H
3 
4 #include <QtOpenGL>
5 
15 class Shader : protected QOpenGLFunctions {
16 private:
17 public:
18  Shader() {
19  initializeOpenGLFunctions();
20 
21  lineShader.create();
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");
26 
27  normalShader.create();
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");
32 
33  bezierShader.create();
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");
38  bezierShader.setPatchVertexCount(4);
39  glBindAttribLocation(bezierShader.programId(), 0, "aPos");
40  glBindAttribLocation(bezierShader.programId(), 1, "aColor");
41  };
42 
43  ~Shader() {
44  lineShader.removeAllShaders();
45  lineShader.release();
46  normalShader.removeAllShaders();
47  normalShader.release();
48  bezierShader.removeAllShaders();
49  bezierShader.release();
50  };
51 
52  QOpenGLShaderProgram normalShader;
53  QOpenGLShaderProgram lineShader;
54  QOpenGLShaderProgram bezierShader;
55 };
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