32 |
32 |
33 public: |
33 public: |
34 GLCompiler (GLRenderer* renderer); |
34 GLCompiler (GLRenderer* renderer); |
35 ~GLCompiler(); |
35 ~GLCompiler(); |
36 |
36 |
37 void initialize(); |
37 Q_SLOT void initialize(); |
38 void prepareVBO (int vbonum); |
38 GLuint vbo (VboClass surface, VboSubclass complement); |
39 GLuint vbo (int vbonum) const; |
39 int vboSize (VboClass surface) const; |
40 int vboSize (int vbonum) const; |
|
41 |
|
42 static int vboNumber (VboClass surface, VboSubclass complement); |
|
43 |
40 |
44 private: |
41 private: |
45 struct ObjectVboData |
42 struct ObjectVboData |
46 { |
43 { |
47 QVector<GLfloat> data[NumVbos]; |
44 QVector<GLfloat> data[NumVbos]; |
55 void needMerge(); |
52 void needMerge(); |
56 Q_SLOT void recompile(); |
53 Q_SLOT void recompile(); |
57 void dropObjectInfo (LDObject* obj); |
54 void dropObjectInfo (LDObject* obj); |
58 Q_SLOT void forgetObject(LDObject* object); |
55 Q_SLOT void forgetObject(LDObject* object); |
59 void stageForCompilation (LDObject* obj); |
56 void stageForCompilation (LDObject* obj); |
|
57 void prepareVBO (int vbonum); |
60 void unstage (LDObject* obj); |
58 void unstage (LDObject* obj); |
|
59 |
|
60 static int vboNumber (VboClass surface, VboSubclass complement); |
61 |
61 |
62 QMap<LDObject*, ObjectVboData> m_objectInfo; |
62 QMap<LDObject*, ObjectVboData> m_objectInfo; |
63 QSet<LDObject*> m_staged; // Objects that need to be compiled |
63 QSet<LDObject*> m_staged; // Objects that need to be compiled |
64 GLuint m_vbo[NumVbos]; |
64 GLuint m_vbo[NumVbos]; |
65 bool m_vboChanged[NumVbos] = {true}; |
65 bool m_vboChanged[NumVbos] = {true}; |