22 |
22 |
23 class GridProgram : public AbstractBasicShaderProgram |
23 class GridProgram : public AbstractBasicShaderProgram |
24 { |
24 { |
25 Q_OBJECT |
25 Q_OBJECT |
26 public: |
26 public: |
27 using AbstractBasicShaderProgram::AbstractBasicShaderProgram; |
27 GridProgram(QObject* parent = nullptr); |
28 void setGridMatrix(const glm::mat4& newGridMatrix); |
28 void setGridMatrix(const glm::mat4& newGridMatrix); |
29 void setGridColor(const QColor& newGridColor); |
29 void setGridColor(const QColor& newGridColor); |
30 protected: |
30 protected: |
31 const char* vertexShaderSource() const override; |
31 const char* vertexShaderSource() const override; |
32 const char* fragmentShaderSource() const override; |
32 const char* fragmentShaderSource() const override; |
36 void setupVertexArrays() override; |
36 void setupVertexArrays() override; |
37 GLenum drawMode() const override; |
37 GLenum drawMode() const override; |
38 QOpenGLBuffer::UsagePattern usagePattern() const override; |
38 QOpenGLBuffer::UsagePattern usagePattern() const override; |
39 private: |
39 private: |
40 glm::vec4 gridColor = {1.0f, 1.0f, 1.0f, 0.75f}; |
40 glm::vec4 gridColor = {1.0f, 1.0f, 1.0f, 0.75f}; |
|
41 std::vector<glm::vec2> gridData; |
41 }; |
42 }; |