1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Data Visualization module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 or (at your option) any later version |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
22 | ** included in the packaging of this file. Please review the following |
23 | ** information to ensure the GNU General Public License requirements will |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
25 | ** |
26 | ** $QT_END_LICENSE$ |
27 | ** |
28 | ****************************************************************************/ |
29 | |
30 | #include "enumtostringmap_p.h" |
31 | |
32 | #ifdef VERBOSE_STATE_STORE |
33 | |
34 | #include <QDebug> |
35 | |
36 | static EnumToStringMap *theInstance = 0; |
37 | static unsigned int theInstanceCount = 0; |
38 | |
39 | EnumToStringMap *EnumToStringMap::newInstance() |
40 | { |
41 | if (theInstance) { |
42 | theInstanceCount++; |
43 | return theInstance; |
44 | } |
45 | |
46 | theInstance = new EnumToStringMap(); |
47 | theInstanceCount++; |
48 | return theInstance; |
49 | } |
50 | |
51 | void EnumToStringMap::deleteInstance() |
52 | { |
53 | theInstanceCount--; |
54 | if (theInstanceCount <= 0) { |
55 | delete theInstance; |
56 | theInstance = 0; |
57 | } |
58 | } |
59 | |
60 | EnumToStringMap::EnumToStringMap() : |
61 | m_unknown("<unknown>" ) |
62 | { |
63 | m_map[GL_ZERO] = "ZERO/null" ; |
64 | |
65 | m_map[GL_DEPTH_BUFFER_BIT] = "DEPTH_BUFFER_BIT" ; |
66 | m_map[GL_STENCIL_BUFFER_BIT] = "STENCIL_BUFFER_BIT" ; |
67 | m_map[GL_COLOR_BUFFER_BIT] = "COLOR_BUFFER_BIT" ; |
68 | |
69 | m_map[GL_STENCIL_BUFFER_BIT] = "STENCIL_BUFFER_BIT" ; |
70 | m_map[GL_COLOR_BUFFER_BIT] = "COLOR_BUFFER_BIT" ; |
71 | |
72 | m_map[GL_POINTS] = "POINTS" ; |
73 | m_map[GL_LINES] = "LINES" ; |
74 | m_map[GL_LINE_LOOP] = "LINE_LOOP" ; |
75 | m_map[GL_LINE_STRIP] = "LINE_STRIP" ; |
76 | m_map[GL_TRIANGLES] = "TRIANGLES" ; |
77 | m_map[GL_TRIANGLE_STRIP] = "TRIANGLE_STRIP" ; |
78 | m_map[GL_TRIANGLE_FAN] = "TRIANGLE_FAN" ; |
79 | |
80 | m_map[GL_SRC_COLOR] = "SRC_COLOR" ; |
81 | m_map[GL_ONE_MINUS_SRC_COLOR] = "ONE_MINUS_SRC_COLOR" ; |
82 | m_map[GL_SRC_ALPHA] = "SRC_ALPHA" ; |
83 | m_map[GL_ONE_MINUS_SRC_ALPHA] = "ONE_MINUS_SRC_ALPHA" ; |
84 | m_map[GL_DST_ALPHA] = "DST_ALPHA" ; |
85 | m_map[GL_ONE_MINUS_DST_ALPHA] = "ONE_MINUS_DST_ALPHA" ; |
86 | |
87 | m_map[GL_DST_COLOR] = "DST_COLOR" ; |
88 | m_map[GL_ONE_MINUS_DST_COLOR] = "ONE_MINUS_DST_COLOR" ; |
89 | m_map[GL_SRC_ALPHA_SATURATE] = "SRC_ALPHA_SATURATE" ; |
90 | |
91 | m_map[GL_FUNC_ADD] = "FUNC_ADD" ; |
92 | m_map[GL_BLEND_EQUATION] = "BLEND_EQUATION" ; |
93 | m_map[GL_BLEND_EQUATION_RGB] = "BLEND_EQUATION_RGB" ; |
94 | m_map[GL_BLEND_EQUATION_ALPHA] = "BLEND_EQUATION_ALPHA" ; |
95 | |
96 | m_map[GL_FUNC_SUBTRACT] = "FUNC_SUBTRACT" ; |
97 | m_map[GL_FUNC_REVERSE_SUBTRACT] = "FUNC_REVERSE_SUBTRACT" ; |
98 | |
99 | m_map[GL_BLEND_DST_RGB] = "BLEND_DST_RGB" ; |
100 | m_map[GL_BLEND_SRC_RGB] = "BLEND_SRC_RGB" ; |
101 | m_map[GL_BLEND_DST_ALPHA] = "BLEND_DST_ALPHA" ; |
102 | m_map[GL_BLEND_SRC_ALPHA] = "BLEND_SRC_ALPHA" ; |
103 | m_map[GL_CONSTANT_COLOR] = "CONSTANT_COLOR" ; |
104 | m_map[GL_ONE_MINUS_CONSTANT_COLOR] = "ONE_MINUS_CONSTANT_COLOR" ; |
105 | m_map[GL_CONSTANT_ALPHA] = "CONSTANT_ALPHA" ; |
106 | m_map[GL_ONE_MINUS_CONSTANT_ALPHA] = "ONE_MINUS_CONSTANT_ALPHA" ; |
107 | m_map[GL_BLEND_COLOR] = "BLEND_COLOR" ; |
108 | |
109 | m_map[GL_ARRAY_BUFFER] = "ARRAY_BUFFER" ; |
110 | m_map[GL_ELEMENT_ARRAY_BUFFER] = "ELEMENT_ARRAY_BUFFER" ; |
111 | m_map[GL_ARRAY_BUFFER_BINDING] = "ARRAY_BUFFER_BINDING" ; |
112 | m_map[GL_ELEMENT_ARRAY_BUFFER_BINDING] = "ELEMENT_ARRAY_BUFFER_BINDING" ; |
113 | |
114 | m_map[GL_STREAM_DRAW] = "STREAM_DRAW" ; |
115 | m_map[GL_STATIC_DRAW] = "STATIC_DRAW" ; |
116 | m_map[GL_DYNAMIC_DRAW] = "DYNAMIC_DRAW" ; |
117 | |
118 | m_map[GL_BUFFER_SIZE] = "BUFFER_SIZE" ; |
119 | m_map[GL_BUFFER_USAGE] = "BUFFER_USAGE" ; |
120 | |
121 | m_map[GL_CURRENT_VERTEX_ATTRIB] = "CURRENT_VERTEX_ATTRIB" ; |
122 | |
123 | m_map[GL_FRONT] = "FRONT" ; |
124 | m_map[GL_BACK] = "BACK" ; |
125 | m_map[GL_FRONT_AND_BACK] = "FRONT_AND_BACK" ; |
126 | |
127 | m_map[GL_CULL_FACE] = "CULL_FACE" ; |
128 | m_map[GL_BLEND] = "BLEND" ; |
129 | m_map[GL_DITHER] = "DITHER" ; |
130 | m_map[GL_STENCIL_TEST] = "STENCIL_TEST" ; |
131 | m_map[GL_DEPTH_TEST] = "DEPTH_TEST" ; |
132 | m_map[GL_SCISSOR_TEST] = "SCISSOR_TEST" ; |
133 | m_map[GL_POLYGON_OFFSET_FILL] = "POLYGON_OFFSET_FILL" ; |
134 | m_map[GL_SAMPLE_ALPHA_TO_COVERAGE] = "SAMPLE_ALPHA_TO_COVERAGE" ; |
135 | m_map[GL_SAMPLE_COVERAGE] = "SAMPLE_COVERAGE" ; |
136 | |
137 | m_map[GL_NO_ERROR] = "NO_ERROR" ; |
138 | m_map[GL_INVALID_ENUM] = "INVALID_ENUM" ; |
139 | m_map[GL_INVALID_VALUE] = "INVALID_VALUE" ; |
140 | m_map[GL_INVALID_OPERATION] = "INVALID_OPERATION" ; |
141 | m_map[GL_OUT_OF_MEMORY] = "OUT_OF_MEMORY" ; |
142 | |
143 | m_map[GL_CW] = "CW" ; |
144 | m_map[GL_CCW] = "CCW" ; |
145 | |
146 | m_map[GL_LINE_WIDTH] = "LINE_WIDTH" ; |
147 | m_map[GL_ALIASED_POINT_SIZE_RANGE] = "ALIASED_POINT_SIZE_RANGE" ; |
148 | m_map[GL_ALIASED_LINE_WIDTH_RANGE] = "ALIASED_LINE_WIDTH_RANGE" ; |
149 | m_map[GL_CULL_FACE_MODE] = "CULL_FACE_MODE" ; |
150 | m_map[GL_FRONT_FACE] = "FRONT_FACE" ; |
151 | m_map[GL_DEPTH_RANGE] = "DEPTH_RANGE" ; |
152 | m_map[GL_DEPTH_WRITEMASK] = "DEPTH_WRITEMASK" ; |
153 | m_map[GL_DEPTH_CLEAR_VALUE] = "DEPTH_CLEAR_VALUE" ; |
154 | m_map[GL_DEPTH_FUNC] = "DEPTH_FUNC" ; |
155 | m_map[GL_STENCIL_CLEAR_VALUE] = "STENCIL_CLEAR_VALUE" ; |
156 | m_map[GL_STENCIL_FUNC] = "STENCIL_FUNC" ; |
157 | m_map[GL_STENCIL_FAIL] = "STENCIL_FAIL" ; |
158 | m_map[GL_STENCIL_PASS_DEPTH_FAIL] = "STENCIL_PASS_DEPTH_FAIL" ; |
159 | m_map[GL_STENCIL_PASS_DEPTH_PASS] = "STENCIL_PASS_DEPTH_PASS" ; |
160 | m_map[GL_STENCIL_REF] = "STENCIL_REF" ; |
161 | m_map[GL_STENCIL_VALUE_MASK] = "STENCIL_VALUE_MASK" ; |
162 | m_map[GL_STENCIL_WRITEMASK] = "STENCIL_WRITEMASK" ; |
163 | m_map[GL_STENCIL_BACK_FUNC] = "STENCIL_BACK_FUNC" ; |
164 | m_map[GL_STENCIL_BACK_FAIL] = "STENCIL_BACK_FAIL" ; |
165 | m_map[GL_STENCIL_BACK_PASS_DEPTH_FAIL] = "STENCIL_BACK_PASS_DEPTH_FAIL" ; |
166 | m_map[GL_STENCIL_BACK_PASS_DEPTH_PASS] = "STENCIL_BACK_PASS_DEPTH_PASS" ; |
167 | m_map[GL_STENCIL_BACK_REF] = "STENCIL_BACK_REF" ; |
168 | m_map[GL_STENCIL_BACK_VALUE_MASK] = "STENCIL_BACK_VALUE_MASK" ; |
169 | m_map[GL_STENCIL_BACK_WRITEMASK] = "STENCIL_BACK_WRITEMASK" ; |
170 | m_map[GL_VIEWPORT] = "VIEWPORT" ; |
171 | m_map[GL_SCISSOR_BOX] = "SCISSOR_BOX" ; |
172 | |
173 | m_map[GL_COLOR_CLEAR_VALUE] = "COLOR_CLEAR_VALUE" ; |
174 | m_map[GL_COLOR_WRITEMASK] = "COLOR_WRITEMASK" ; |
175 | m_map[GL_UNPACK_ALIGNMENT] = "UNPACK_ALIGNMENT" ; |
176 | m_map[GL_PACK_ALIGNMENT] = "PACK_ALIGNMENT" ; |
177 | m_map[GL_MAX_TEXTURE_SIZE] = "MAX_TEXTURE_SIZE" ; |
178 | m_map[GL_MAX_VIEWPORT_DIMS] = "MAX_VIEWPORT_DIMS" ; |
179 | m_map[GL_SUBPIXEL_BITS] = "SUBPIXEL_BITS" ; |
180 | m_map[GL_RED_BITS] = "RED_BITS" ; |
181 | m_map[GL_GREEN_BITS] = "GREEN_BITS" ; |
182 | m_map[GL_BLUE_BITS] = "BLUE_BITS" ; |
183 | m_map[GL_ALPHA_BITS] = "ALPHA_BITS" ; |
184 | m_map[GL_DEPTH_BITS] = "DEPTH_BITS" ; |
185 | m_map[GL_STENCIL_BITS] = "STENCIL_BITS" ; |
186 | m_map[GL_POLYGON_OFFSET_UNITS] = "POLYGON_OFFSET_UNITS" ; |
187 | |
188 | m_map[GL_POLYGON_OFFSET_FACTOR] = "POLYGON_OFFSET_FACTOR" ; |
189 | m_map[GL_TEXTURE_BINDING_2D] = "TEXTURE_BINDING_2D" ; |
190 | m_map[GL_SAMPLE_BUFFERS] = "SAMPLE_BUFFERS" ; |
191 | m_map[GL_SAMPLES] = "SAMPLES" ; |
192 | m_map[GL_SAMPLE_COVERAGE_VALUE] = "SAMPLE_COVERAGE_VALUE" ; |
193 | m_map[GL_SAMPLE_COVERAGE_INVERT] = "SAMPLE_COVERAGE_INVERT" ; |
194 | |
195 | m_map[GL_COMPRESSED_TEXTURE_FORMATS] = "COMPRESSED_TEXTURE_FORMATS" ; |
196 | |
197 | m_map[GL_DONT_CARE] = "DONT_CARE" ; |
198 | m_map[GL_FASTEST] = "FASTEST" ; |
199 | m_map[GL_NICEST] = "NICEST" ; |
200 | |
201 | m_map[GL_GENERATE_MIPMAP_HINT] = "GENERATE_MIPMAP_HINT" ; |
202 | |
203 | m_map[GL_BYTE] = "BYTE" ; |
204 | m_map[GL_UNSIGNED_BYTE] = "UNSIGNED_BYTE" ; |
205 | m_map[GL_SHORT] = "SHORT" ; |
206 | m_map[GL_UNSIGNED_SHORT] = "UNSIGNED_SHORT" ; |
207 | m_map[GL_INT] = "INT" ; |
208 | m_map[GL_UNSIGNED_INT] = "UNSIGNED_INT" ; |
209 | m_map[GL_FLOAT] = "FLOAT" ; |
210 | |
211 | m_map[GL_DEPTH_COMPONENT] = "DEPTH_COMPONENT" ; |
212 | m_map[GL_ALPHA] = "ALPHA" ; |
213 | m_map[GL_RGB] = "RGB" ; |
214 | m_map[GL_RGBA] = "RGBA" ; |
215 | m_map[GL_LUMINANCE] = "LUMINANCE" ; |
216 | m_map[GL_LUMINANCE_ALPHA] = "LUMINANCE_ALPHA" ; |
217 | |
218 | m_map[GL_UNSIGNED_SHORT_4_4_4_4] = "UNSIGNED_SHORT_4_4_4_4" ; |
219 | m_map[GL_UNSIGNED_SHORT_5_5_5_1] = "UNSIGNED_SHORT_5_5_5_1" ; |
220 | m_map[GL_UNSIGNED_SHORT_5_6_5] = "UNSIGNED_SHORT_5_6_5" ; |
221 | |
222 | m_map[GL_FRAGMENT_SHADER] = "FRAGMENT_SHADER" ; |
223 | m_map[GL_VERTEX_SHADER] = "VERTEX_SHADER" ; |
224 | m_map[GL_MAX_VERTEX_ATTRIBS] = "MAX_VERTEX_ATTRIBS" ; |
225 | m_map[GL_MAX_VERTEX_UNIFORM_VECTORS] = "MAX_VERTEX_UNIFORM_VECTORS" ; |
226 | m_map[GL_MAX_VARYING_VECTORS] = "MAX_VARYING_VECTORS" ; |
227 | m_map[GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS] = "MAX_COMBINED_TEXTURE_IMAGE_UNITS" ; |
228 | m_map[GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS] = "MAX_VERTEX_TEXTURE_IMAGE_UNITS" ; |
229 | m_map[GL_MAX_TEXTURE_IMAGE_UNITS] = "MAX_TEXTURE_IMAGE_UNITS" ; |
230 | m_map[GL_MAX_FRAGMENT_UNIFORM_VECTORS] = "MAX_FRAGMENT_UNIFORM_VECTORS" ; |
231 | m_map[GL_SHADER_TYPE] = "SHADER_TYPE" ; |
232 | m_map[GL_DELETE_STATUS] = "DELETE_STATUS" ; |
233 | m_map[GL_LINK_STATUS] = "LINK_STATUS" ; |
234 | m_map[GL_VALIDATE_STATUS] = "VALIDATE_STATUS" ; |
235 | m_map[GL_ATTACHED_SHADERS] = "ATTACHED_SHADERS" ; |
236 | m_map[GL_ACTIVE_UNIFORMS] = "ACTIVE_UNIFORMS" ; |
237 | m_map[GL_ACTIVE_ATTRIBUTES] = "ACTIVE_ATTRIBUTES" ; |
238 | m_map[GL_SHADING_LANGUAGE_VERSION] = "SHADING_LANGUAGE_VERSION" ; |
239 | m_map[GL_CURRENT_PROGRAM] = "CURRENT_PROGRAM" ; |
240 | |
241 | m_map[GL_NEVER] = "NEVER" ; |
242 | m_map[GL_LESS] = "LESS" ; |
243 | m_map[GL_EQUAL] = "EQUAL" ; |
244 | m_map[GL_LEQUAL] = "LEQUAL" ; |
245 | m_map[GL_GREATER] = "GREATER" ; |
246 | m_map[GL_NOTEQUAL] = "NOTEQUAL" ; |
247 | m_map[GL_GEQUAL] = "GEQUAL" ; |
248 | m_map[GL_ALWAYS] = "ALWAYS" ; |
249 | |
250 | m_map[GL_KEEP] = "KEEP" ; |
251 | m_map[GL_REPLACE] = "REPLACE" ; |
252 | m_map[GL_INCR] = "INCR" ; |
253 | m_map[GL_DECR] = "DECR" ; |
254 | m_map[GL_INVERT] = "INVERT" ; |
255 | m_map[GL_INCR_WRAP] = "INCR_WRAP" ; |
256 | m_map[GL_DECR_WRAP] = "DECR_WRAP" ; |
257 | |
258 | m_map[GL_VENDOR] = "VENDOR" ; |
259 | m_map[GL_RENDERER] = "RENDERER" ; |
260 | m_map[GL_VERSION] = "VERSION" ; |
261 | |
262 | m_map[GL_NEAREST] = "NEAREST" ; |
263 | m_map[GL_LINEAR] = "LINEAR" ; |
264 | |
265 | m_map[GL_NEAREST_MIPMAP_NEAREST] = "NEAREST_MIPMAP_NEAREST" ; |
266 | m_map[GL_LINEAR_MIPMAP_NEAREST] = "LINEAR_MIPMAP_NEAREST" ; |
267 | m_map[GL_NEAREST_MIPMAP_LINEAR] = "NEAREST_MIPMAP_LINEAR" ; |
268 | m_map[GL_LINEAR_MIPMAP_LINEAR] = "LINEAR_MIPMAP_LINEAR" ; |
269 | |
270 | m_map[GL_TEXTURE_MAG_FILTER] = "TEXTURE_MAG_FILTER" ; |
271 | m_map[GL_TEXTURE_MIN_FILTER] = "TEXTURE_MIN_FILTER" ; |
272 | m_map[GL_TEXTURE_WRAP_S] = "TEXTURE_WRAP_S" ; |
273 | m_map[GL_TEXTURE_WRAP_T] = "TEXTURE_WRAP_T" ; |
274 | |
275 | m_map[GL_TEXTURE_2D] = "TEXTURE_2D" ; |
276 | m_map[GL_TEXTURE] = "TEXTURE" ; |
277 | |
278 | m_map[GL_TEXTURE_CUBE_MAP] = "TEXTURE_CUBE_MAP" ; |
279 | m_map[GL_TEXTURE_BINDING_CUBE_MAP] = "TEXTURE_BINDING_CUBE_MAP" ; |
280 | m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_X] = "TEXTURE_CUBE_MAP_POSITIVE_X" ; |
281 | m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_X] = "TEXTURE_CUBE_MAP_NEGATIVE_X" ; |
282 | m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Y] = "TEXTURE_CUBE_MAP_POSITIVE_Y" ; |
283 | m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Y] = "TEXTURE_CUBE_MAP_NEGATIVE_Y" ; |
284 | m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Z] = "TEXTURE_CUBE_MAP_POSITIVE_Z" ; |
285 | m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Z] = "TEXTURE_CUBE_MAP_NEGATIVE_Z" ; |
286 | m_map[GL_MAX_CUBE_MAP_TEXTURE_SIZE] = "MAX_CUBE_MAP_TEXTURE_SIZE" ; |
287 | |
288 | m_map[GL_TEXTURE0] = "TEXTURE0" ; |
289 | m_map[GL_TEXTURE1] = "TEXTURE1" ; |
290 | m_map[GL_TEXTURE2] = "TEXTURE2" ; |
291 | m_map[GL_TEXTURE3] = "TEXTURE3" ; |
292 | m_map[GL_TEXTURE4] = "TEXTURE4" ; |
293 | m_map[GL_TEXTURE5] = "TEXTURE5" ; |
294 | m_map[GL_TEXTURE6] = "TEXTURE6" ; |
295 | m_map[GL_TEXTURE7] = "TEXTURE7" ; |
296 | m_map[GL_TEXTURE8] = "TEXTURE8" ; |
297 | m_map[GL_TEXTURE9] = "TEXTURE9" ; |
298 | m_map[GL_TEXTURE10] = "TEXTURE10" ; |
299 | m_map[GL_TEXTURE11] = "TEXTURE11" ; |
300 | m_map[GL_TEXTURE12] = "TEXTURE12" ; |
301 | m_map[GL_TEXTURE13] = "TEXTURE13" ; |
302 | m_map[GL_TEXTURE14] = "TEXTURE14" ; |
303 | m_map[GL_TEXTURE15] = "TEXTURE15" ; |
304 | m_map[GL_TEXTURE16] = "TEXTURE16" ; |
305 | m_map[GL_TEXTURE17] = "TEXTURE17" ; |
306 | m_map[GL_TEXTURE18] = "TEXTURE18" ; |
307 | m_map[GL_TEXTURE19] = "TEXTURE19" ; |
308 | m_map[GL_TEXTURE20] = "TEXTURE20" ; |
309 | m_map[GL_TEXTURE21] = "TEXTURE21" ; |
310 | m_map[GL_TEXTURE22] = "TEXTURE22" ; |
311 | m_map[GL_TEXTURE23] = "TEXTURE23" ; |
312 | m_map[GL_TEXTURE24] = "TEXTURE24" ; |
313 | m_map[GL_TEXTURE25] = "TEXTURE25" ; |
314 | m_map[GL_TEXTURE26] = "TEXTURE26" ; |
315 | m_map[GL_TEXTURE27] = "TEXTURE27" ; |
316 | m_map[GL_TEXTURE28] = "TEXTURE28" ; |
317 | m_map[GL_TEXTURE29] = "TEXTURE29" ; |
318 | m_map[GL_TEXTURE30] = "TEXTURE30" ; |
319 | m_map[GL_TEXTURE31] = "TEXTURE31" ; |
320 | m_map[GL_ACTIVE_TEXTURE] = "ACTIVE_TEXTURE" ; |
321 | |
322 | m_map[GL_REPEAT] = "REPEAT" ; |
323 | m_map[GL_CLAMP_TO_EDGE] = "CLAMP_TO_EDGE" ; |
324 | m_map[GL_MIRRORED_REPEAT] = "MIRRORED_REPEAT" ; |
325 | |
326 | m_map[GL_FLOAT_VEC2] = "FLOAT_VEC2" ; |
327 | m_map[GL_FLOAT_VEC3] = "FLOAT_VEC3" ; |
328 | m_map[GL_FLOAT_VEC4] = "FLOAT_VEC4" ; |
329 | m_map[GL_INT_VEC2] = "INT_VEC2" ; |
330 | m_map[GL_INT_VEC3] = "INT_VEC3" ; |
331 | m_map[GL_INT_VEC4] = "INT_VEC4" ; |
332 | m_map[GL_BOOL] = "BOOL" ; |
333 | m_map[GL_BOOL_VEC2] = "BOOL_VEC2" ; |
334 | m_map[GL_BOOL_VEC3] = "BOOL_VEC3" ; |
335 | m_map[GL_BOOL_VEC4] = "BOOL_VEC4" ; |
336 | m_map[GL_FLOAT_MAT2] = "FLOAT_MAT2" ; |
337 | m_map[GL_FLOAT_MAT3] = "FLOAT_MAT3" ; |
338 | m_map[GL_FLOAT_MAT4] = "FLOAT_MAT4" ; |
339 | m_map[GL_SAMPLER_2D] = "SAMPLER_2D" ; |
340 | m_map[GL_SAMPLER_CUBE] = "SAMPLER_CUBE" ; |
341 | |
342 | m_map[GL_VERTEX_ATTRIB_ARRAY_ENABLED] = "VERTEX_ATTRIB_ARRAY_ENABLED" ; |
343 | m_map[GL_VERTEX_ATTRIB_ARRAY_SIZE] = "VERTEX_ATTRIB_ARRAY_SIZE" ; |
344 | m_map[GL_VERTEX_ATTRIB_ARRAY_STRIDE] = "VERTEX_ATTRIB_ARRAY_STRIDE" ; |
345 | m_map[GL_VERTEX_ATTRIB_ARRAY_TYPE] = "VERTEX_ATTRIB_ARRAY_TYPE" ; |
346 | m_map[GL_VERTEX_ATTRIB_ARRAY_NORMALIZED] = "VERTEX_ATTRIB_ARRAY_NORMALIZED" ; |
347 | m_map[GL_VERTEX_ATTRIB_ARRAY_POINTER] = "VERTEX_ATTRIB_ARRAY_POINTER" ; |
348 | m_map[GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING] = "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" ; |
349 | |
350 | m_map[GL_COMPILE_STATUS] = "COMPILE_STATUS" ; |
351 | |
352 | m_map[GL_LOW_FLOAT] = "LOW_FLOAT" ; |
353 | m_map[GL_MEDIUM_FLOAT] = "MEDIUM_FLOAT" ; |
354 | m_map[GL_HIGH_FLOAT] = "HIGH_FLOAT" ; |
355 | m_map[GL_LOW_INT] = "LOW_INT" ; |
356 | m_map[GL_MEDIUM_INT] = "MEDIUM_INT" ; |
357 | m_map[GL_HIGH_INT] = "HIGH_INT" ; |
358 | |
359 | m_map[GL_FRAMEBUFFER] = "FRAMEBUFFER" ; |
360 | m_map[GL_RENDERBUFFER] = "RENDERBUFFER" ; |
361 | |
362 | m_map[GL_RGBA4] = "RGBA4" ; |
363 | m_map[GL_RGB5_A1] = "RGB5_A1" ; |
364 | m_map[GL_RGB565] = "RGB565" ; |
365 | m_map[GL_DEPTH_COMPONENT16] = "DEPTH_COMPONENT16" ; |
366 | m_map[GL_STENCIL_INDEX] = "STENCIL_INDEX" ; |
367 | m_map[GL_STENCIL_INDEX8] = "STENCIL_INDEX8" ; |
368 | |
369 | m_map[GL_RENDERBUFFER_WIDTH] = "RENDERBUFFER_WIDTH" ; |
370 | m_map[GL_RENDERBUFFER_HEIGHT] = "RENDERBUFFER_HEIGHT" ; |
371 | m_map[GL_RENDERBUFFER_INTERNAL_FORMAT] = "RENDERBUFFER_INTERNAL_FORMAT" ; |
372 | m_map[GL_RENDERBUFFER_RED_SIZE] = "RENDERBUFFER_RED_SIZE" ; |
373 | m_map[GL_RENDERBUFFER_GREEN_SIZE] = "RENDERBUFFER_GREEN_SIZE" ; |
374 | m_map[GL_RENDERBUFFER_BLUE_SIZE] = "RENDERBUFFER_BLUE_SIZE" ; |
375 | m_map[GL_RENDERBUFFER_ALPHA_SIZE] = "RENDERBUFFER_ALPHA_SIZE" ; |
376 | m_map[GL_RENDERBUFFER_DEPTH_SIZE] = "RENDERBUFFER_DEPTH_SIZE" ; |
377 | m_map[GL_RENDERBUFFER_STENCIL_SIZE] = "RENDERBUFFER_STENCIL_SIZE" ; |
378 | |
379 | m_map[GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE] = "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" ; |
380 | m_map[GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME] = "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" ; |
381 | m_map[GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" ; |
382 | m_map[GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE] = |
383 | "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" ; |
384 | |
385 | m_map[GL_COLOR_ATTACHMENT0] = "COLOR_ATTACHMENT0" ; |
386 | m_map[GL_DEPTH_ATTACHMENT] = "DEPTH_ATTACHMENT" ; |
387 | m_map[GL_STENCIL_ATTACHMENT] = "STENCIL_ATTACHMENT" ; |
388 | |
389 | m_map[GL_FRAMEBUFFER_COMPLETE] = "FRAMEBUFFER_COMPLETE" ; |
390 | m_map[GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT] = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT" ; |
391 | m_map[GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT] = |
392 | "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" ; |
393 | m_map[GL_FRAMEBUFFER_UNSUPPORTED] = "FRAMEBUFFER_UNSUPPORTED" ; |
394 | |
395 | m_map[GL_FRAMEBUFFER_BINDING] = "FRAMEBUFFER_BINDING" ; |
396 | #if !defined(QT_OPENGL_ES_2) |
397 | m_map[GL_RENDERBUFFER_BINDING] = "RENDERBUFFER_BINDING" ; |
398 | #else |
399 | m_map[GL_RENDERBUFFER] = "RENDERBUFFER_BINDING" ; |
400 | #endif |
401 | m_map[GL_MAX_RENDERBUFFER_SIZE] = "MAX_RENDERBUFFER_SIZE" ; |
402 | |
403 | m_map[GL_INVALID_FRAMEBUFFER_OPERATION] = "INVALID_FRAMEBUFFER_OPERATION" ; |
404 | } |
405 | |
406 | QString EnumToStringMap::lookUp(const GLuint value) const |
407 | { |
408 | if (m_map.contains(value)) |
409 | return m_map[value]; |
410 | |
411 | return QString("0x0%1" ).arg(value, 0, 16); |
412 | } |
413 | #endif |
414 | |