1 /* |
|
2 * LDForge: LDraw parts authoring CAD |
|
3 * Copyright (C) 2013, 2014 Santeri Piippo |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation, either version 3 of the License, or |
|
8 * (at your option) any later version. |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 */ |
|
18 |
|
19 #ifndef LDFORGE_GLSHARED_H |
|
20 #define LDFORGE_GLSHARED_H |
|
21 #include <QString> |
|
22 |
|
23 class LDObject; |
|
24 |
|
25 struct LDPolygon |
|
26 { |
|
27 char num; |
|
28 Vertex vertices[4]; |
|
29 int id; |
|
30 int color; |
|
31 QString origin; |
|
32 |
|
33 inline int numVertices() const |
|
34 { |
|
35 return (num == 5) ? 4 : num; |
|
36 } |
|
37 }; |
|
38 |
|
39 enum EVBOSurface |
|
40 { |
|
41 VBOSF_Lines, |
|
42 VBOSF_Triangles, |
|
43 VBOSF_Quads, |
|
44 VBOSF_CondLines, |
|
45 VBOSF_NumSurfaces |
|
46 }; |
|
47 |
|
48 enum EVBOComplement |
|
49 { |
|
50 VBOCM_Surfaces, |
|
51 VBOCM_NormalColors, |
|
52 VBOCM_PickColors, |
|
53 VBOCM_BFCFrontColors, |
|
54 VBOCM_BFCBackColors, |
|
55 VBOCM_NumComplements |
|
56 }; |
|
57 |
|
58 // KDevelop doesn't seem to understand some VBO stuff |
|
59 #ifdef IN_IDE_PARSER |
|
60 using GLenum = unsigned int; |
|
61 using GLuint = unsigned int; |
|
62 void glBindBuffer (GLenum, GLuint); |
|
63 void glGenBuffers (GLuint, GLuint*); |
|
64 void glDeleteBuffers (GLuint, GLuint*); |
|
65 void glBufferData (GLuint, GLuint, void*, GLuint); |
|
66 #endif |
|
67 |
|
68 static const int g_numVBOs = VBOSF_NumSurfaces * VBOCM_NumComplements; |
|
69 |
|
70 #endif // LDFORGE_GLSHARED_H |
|