src/glCompiler.h

changeset 978
4603d8fd063e
parent 970
c8aae45afd85
child 986
525921eae58c
equal deleted inserted replaced
977:dc3ceb65cda7 978:4603d8fd063e
19 #pragma once 19 #pragma once
20 #include "main.h" 20 #include "main.h"
21 #include "glRenderer.h" 21 #include "glRenderer.h"
22 #include "glShared.h" 22 #include "glShared.h"
23 #include <QMap> 23 #include <QMap>
24 #include <QSet>
24 25
25 // ============================================================================= 26 // =============================================================================
26 // 27 //
27 class GLCompiler : public HierarchyElement, protected QOpenGLFunctions 28 class GLCompiler : public HierarchyElement, protected QOpenGLFunctions
28 { 29 {
34 }; 35 };
35 36
36 GLCompiler (GLRenderer* renderer); 37 GLCompiler (GLRenderer* renderer);
37 ~GLCompiler(); 38 ~GLCompiler();
38 void compileDocument (LDDocument* doc); 39 void compileDocument (LDDocument* doc);
39 void dropObject (LDObject* obj); 40 void dropObjectInfo (LDObject* obj);
40 void initialize(); 41 void initialize();
41 QColor getColorForPolygon (LDPolygon& poly, LDObject* topobj, 42 QColor getColorForPolygon (LDPolygon& poly, LDObject* topobj,
42 EVBOComplement complement) const; 43 EVBOComplement complement) const;
43 QColor indexColorForID (int id) const; 44 QColor indexColorForID (int id) const;
44 void needMerge(); 45 void needMerge();
68 void compileStaged(); 69 void compileStaged();
69 void compileObject (LDObject* obj); 70 void compileObject (LDObject* obj);
70 void compilePolygon (LDPolygon& poly, LDObject* topobj, ObjectVBOInfo* objinfo); 71 void compilePolygon (LDPolygon& poly, LDObject* topobj, ObjectVBOInfo* objinfo);
71 72
72 QMap<LDObject*, ObjectVBOInfo> m_objectInfo; 73 QMap<LDObject*, ObjectVBOInfo> m_objectInfo;
73 LDObjectList m_staged; // Objects that need to be compiled 74 QSet<LDObject*> m_staged; // Objects that need to be compiled
74 GLuint m_vbo[g_numVBOs]; 75 GLuint m_vbo[g_numVBOs];
75 bool m_vboChanged[g_numVBOs]; 76 bool m_vboChanged[g_numVBOs];
76 int m_vboSizes[g_numVBOs]; 77 int m_vboSizes[g_numVBOs];
77 GLRenderer* m_renderer; 78 GLRenderer* m_renderer;
78 }; 79 };
79 80
80 #define CHECK_GL_ERROR() { CheckGLErrorImpl (__FILE__, __LINE__); } 81 #define CHECK_GL_ERROR() { CheckGLErrorImpl (__FILE__, __LINE__); }
81 void CheckGLErrorImpl (const char* file, int line); 82 void CheckGLErrorImpl (const char* file, int line);

mercurial