Wed, 15 Jun 2022 12:33:16 +0300
remove old todo
118 | 1 | #ifndef VERTEXPROGRAM_H |
2 | #define VERTEXPROGRAM_H | |
3 | #include "basicshaderprogram.h" | |
214
8e1fe64ce4e3
begin refactor of gl side
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
200
diff
changeset
|
4 | class VertexMap; |
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); | |
214
8e1fe64ce4e3
begin refactor of gl side
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
200
diff
changeset
|
20 | void build(const VertexMap* 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 |