Sat, 11 Jun 2022 14:30:30 +0300
Rewrite dependency loading
118 | 1 | #ifndef VERTEXPROGRAM_H |
2 | #define VERTEXPROGRAM_H | |
3 | #include "basicshaderprogram.h" | |
200 | 4 | class EditorTabWidget; |
118 | 5 | |
6 | class VertexProgram : public AbstractBasicShaderProgram | |
7 | { | |
8 | public: | |
119 | 9 | enum FragmentStyle |
10 | { | |
11 | Normal, | |
12 | Id | |
13 | }; | |
118 | 14 | struct Vertex |
15 | { | |
16 | glm::vec3 position; | |
17 | glm::vec3 color; | |
18 | }; | |
19 | VertexProgram(QObject* parent = nullptr); | |
200 | 20 | void build(const EditorTabWidget* document); |
118 | 21 | protected: |
22 | const char* vertexShaderSource() const override; | |
23 | const char* fragmentShaderSource() const override; | |
24 | const void* vertexData() const override; | |
25 | int vertexSize() const override; | |
26 | int vertexCount() const override; | |
27 | void setupVertexArrays() override; | |
28 | GLenum drawMode() const override; | |
29 | QOpenGLBuffer::UsagePattern usagePattern() const override; | |
119 | 30 | void setFragmentStyle(FragmentStyle newFragmentStyle); |
118 | 31 | private: |
32 | std::vector<Vertex> data; | |
119 | 33 | FragmentStyle fragmentStyle = Normal; |
118 | 34 | }; |
35 | ||
36 | #endif // VERTEXPROGRAM_H |