Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
vlxutils.hpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
32 #ifndef vlxutils_INCLUDE_ONCE
33 #define vlxutils_INCLUDE_ONCE
34 
35 #include <vlX/Value.hpp>
36 #include <vlCore/Matrix4.hpp>
37 #include <vlCore/Vector4.hpp>
38 #include <vlCore/Log.hpp>
39 #include <vlCore/Say.hpp>
40 #include <vlX/Serializer.hpp>
41 
42 namespace vlX
43 {
44  inline std::string vlx_makeTag(const vl::Object* obj) { return std::string("<") + obj->classType().name() + ">"; }
45 
46  inline VLXValue vlx_Identifier(const std::string& str) { return VLXValue(str.c_str(), VLXValue::Identifier); }
47 
48  inline VLXValue vlx_ID(const std::string& str) { return VLXValue(str.c_str(), VLXValue::ID); }
49 
50  inline VLXValue vlx_String(const std::string& str) { return VLXValue(str.c_str(), VLXValue::String); }
51 
52  inline VLXValue vlx_Rawtext(const std::string& str) { return VLXValue( new VLXRawtextBlock(NULL, str.c_str()) ); }
53 
54  inline vl::vec2 vlx_vec2(const VLXArrayReal* arr) { VL_CHECK(arr->value().size() == 2); vl::vec2 v; arr->copyTo(v.ptr()); return v; }
55 
56  inline vl::vec3 vlx_vec3(const VLXArrayReal* arr) { VL_CHECK(arr->value().size() == 3); vl::vec3 v; arr->copyTo(v.ptr()); return v; }
57 
58  inline vl::vec4 vlx_vec4(const VLXArrayReal* arr) { VL_CHECK(arr->value().size() == 4); vl::vec4 v; arr->copyTo(v.ptr()); return v; }
59 
60  inline vl::ivec4 vlx_ivec4(const VLXArrayInteger* arr) { VL_CHECK(arr->value().size() == 4); vl::ivec4 v; arr->copyTo(v.ptr()); return v; }
61 
62  inline vl::uvec4 vlx_uivec4(const VLXArrayInteger* arr) { VL_CHECK(arr->value().size() == 4); vl::uvec4 v; arr->copyTo(v.ptr()); return v; }
63 
64  inline VLXValue vlx_toValue(const std::vector<int>& vec)
65  {
66  VLXValue value;
67  value.setArray( new VLXArrayInteger );
68  value.getArrayInteger()->value().resize( vec.size() );
69  if (vec.size())
70  value.getArrayInteger()->copyFrom(&vec[0]);
71  return value;
72  }
73 
74  inline VLXValue vlx_toValue(const vl::vec4& vec)
75  {
76  VLXValue val( new VLXArrayReal );
77  VLXArrayReal* arr = val.getArrayReal();
78  arr->value().resize(4);
79  arr->value()[0] = vec.x();
80  arr->value()[1] = vec.y();
81  arr->value()[2] = vec.z();
82  arr->value()[3] = vec.w();
83  return val;
84  }
85 
86  inline VLXValue vlx_toValue(const vl::ivec4& vec)
87  {
88  VLXValue val( new VLXArrayInteger );
89  VLXArrayInteger* arr = val.getArrayInteger();
90  arr->value().resize(4);
91  arr->value()[0] = vec.x();
92  arr->value()[1] = vec.y();
93  arr->value()[2] = vec.z();
94  arr->value()[3] = vec.w();
95  return val;
96  }
97 
98  inline VLXValue vlx_toValue(const vl::uvec4& vec)
99  {
100  VLXValue val( new VLXArrayInteger );
101  VLXArrayInteger* arr = val.getArrayInteger();
102  arr->value().resize(4);
103  arr->value()[0] = vec.x();
104  arr->value()[1] = vec.y();
105  arr->value()[2] = vec.z();
106  arr->value()[3] = vec.w();
107  return val;
108  }
109 
110  inline VLXValue vlx_toValue(const vl::vec3& vec)
111  {
112  VLXValue val( new VLXArrayReal );
113  VLXArrayReal* arr = val.getArrayReal();
114  arr->value().resize(3);
115  arr->value()[0] = vec.x();
116  arr->value()[1] = vec.y();
117  arr->value()[2] = vec.z();
118  return val;
119  }
120 
121  inline VLXValue vlx_toValue(const vl::vec2& vec)
122  {
123  VLXValue val( new VLXArrayReal );
124  VLXArrayReal* arr = val.getArrayReal();
125  arr->value().resize(2);
126  arr->value()[0] = vec.x();
127  arr->value()[1] = vec.y();
128  return val;
129  }
130 
131  inline bool vlx_isTranslation(const vl::mat4& mat)
132  {
133  vl::mat4 tmp = mat;
134  tmp.setT( vl::vec3(0,0,0) );
135  return tmp.isIdentity();
136  }
137 
138  inline bool vlx_isScaling(const vl::mat4& mat)
139  {
140  vl::mat4 tmp = mat;
141  tmp.e(0,0) = 1;
142  tmp.e(1,1) = 1;
143  tmp.e(2,2) = 1;
144  return tmp.isIdentity();
145  }
146 
147  inline VLXValue vlx_toValue(const vl::mat4& mat)
148  {
149  VLXValue matrix_list( new VLXList );
150 
151  if (vlx_isTranslation(mat))
152  {
153  VLXValue value( new VLXArrayReal("<Translate>") );
154  value.getArrayReal()->value().resize(3);
155  value.getArrayReal()->value()[0] = mat.getT().x();
156  value.getArrayReal()->value()[1] = mat.getT().y();
157  value.getArrayReal()->value()[2] = mat.getT().z();
158  matrix_list.getList()->value().push_back( value );
159  }
160  else
161  if (vlx_isScaling(mat))
162  {
163  VLXValue value( new VLXArrayReal("<Scale>") );
164  value.getArrayReal()->value().resize(3);
165  value.getArrayReal()->value()[0] = mat.e(0,0);
166  value.getArrayReal()->value()[1] = mat.e(1,1);
167  value.getArrayReal()->value()[2] = mat.e(2,2);
168  matrix_list.getList()->value().push_back( value );
169  }
170  else
171  {
172  VLXValue value( new VLXArrayReal("<Matrix>") );
173  value.getArrayReal()->value().resize(4*4);
174  // if we transpose this we have to transpose also the uniform matrices
175  value.getArrayReal()->copyFrom(mat.ptr());
176  matrix_list.getList()->value().push_back( value );
177  }
178 
179  return matrix_list;
180  }
181 
182  inline vl::mat4 vlx_mat4( const VLXArrayReal* arr )
183  {
184  vl::mat4 mat;
185  arr->copyTo(mat.ptr());
186  return mat;
187  }
188 
189  inline vl::mat4 vlx_mat4( const VLXList* list )
190  {
191  vl::mat4 mat;
192 
193  for(size_t i=0; i<list->value().size(); ++i)
194  {
195  const VLXValue& value = list->value()[i];
196  if (value.type() != VLXValue::ArrayReal)
197  {
198  vl::Log::error( vl::Say("Line %n : parse error during matrix import.\n") << value.lineNumber() );
199  return vl::mat4::getNull();
200  }
201  // composition of subtransforms is made by post multiplication like for COLLADA.
202  const VLXArrayReal* arr = value.getArrayReal();
203  if (arr->tag() == "<Translate>")
204  {
205  vl::vec3 tr = vlx_vec3( arr );
206  mat = mat * vl::mat4::getTranslation(tr);
207  }
208  else
209  if (arr->tag() == "<Scale>")
210  {
211  vl::vec3 sc = vlx_vec3( arr );
212  mat = mat * vl::mat4::getScaling(sc);
213  }
214  else
215  if (arr->tag() == "<Matrix>")
216  {
217  vl::mat4 m = vlx_mat4( arr );
218  mat = mat * m;
219  }
220  else
221  if (arr->tag() == "<LookAt>")
222  {
223  // implements the camera's view-matrix look-at as specified by COLLADA
224  if (arr->value().size() != 9)
225  {
226  vl::Log::error( vl::Say("Line %n : <LookAt> must have 9 floats, 3 for 'eye', 3 for 'look' and 3 for 'up'.\n") << arr->lineNumber() << arr->tag() );
227  }
228  else
229  {
230  vl::vec3 eye, look, up;
231  eye.x() = (float)arr->value()[0];
232  eye.y() = (float)arr->value()[1];
233  eye.z() = (float)arr->value()[2];
234  look.x() = (float)arr->value()[3];
235  look.y() = (float)arr->value()[4];
236  look.z() = (float)arr->value()[5];
237  up.x() = (float)arr->value()[6];
238  up.y() = (float)arr->value()[7];
239  up.z() = (float)arr->value()[8];
240  mat = mat * vl::mat4::getLookAt(eye, look, up);
241  }
242  }
243  else
244  if (arr->tag() == "<Skew>")
245  {
246  vl::Log::error("<Skew> tag not yet supported.\n");
247  }
248  else
249  {
250  vl::Log::error( vl::Say("Line %n : unknown tag '%s' ignored.\n") << arr->lineNumber() << arr->tag() );
251  }
252  }
253 
254  return mat;
255  }
256 
258  {
259  switch(pt)
260  {
261  default:
262  case vl::PMT_UserProjection: return "PMT_UserProjection";
263  case vl::PMT_OrthographicProjection: return "PMT_OrthographicProjection";
264  case vl::PMT_PerspectiveProjection: return "PMT_PerspectiveProjection";
265  case vl::PMT_PerspectiveProjectionFrustum: return "PMT_PerspectiveProjectionFrustum";
266  }
267  }
268 
270  {
271  if( value.getIdentifier() == "PMT_OrthographicProjection") return vl::PMT_OrthographicProjection;
272  if( value.getIdentifier() == "PMT_PerspectiveProjection") return vl::PMT_PerspectiveProjection;
273  if( value.getIdentifier() == "PMT_PerspectiveProjectionFrustum") return vl::PMT_PerspectiveProjectionFrustum;
274  if( value.getIdentifier() == "PMT_UserProjection") return vl::PMT_UserProjection;
275 
276  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
278  return vl::PMT_UserProjection;
279  }
280 
281  inline const char* vlx_EClearColorMode(vl::EClearColorMode ccm)
282  {
283  switch(ccm)
284  {
285  default:
286  case vl::CCM_Float: return "CCM_Float";
287  case vl::CCM_Int: return "CCM_Int";
288  case vl::CCM_UInt: return "CCM_UInt";
289  }
290  }
291 
293  {
294  if( value.getIdentifier() == "CCM_Int") return vl::CCM_Int;
295  if( value.getIdentifier() == "CCM_UInt") return vl::CCM_UInt;
296  if( value.getIdentifier() == "CCM_Float") return vl::CCM_Float;
297 
298  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
300  return vl::CCM_Float;
301  }
302 
303  inline const char* vlx_EClearFlags(vl::EClearFlags cf)
304  {
305  switch(cf)
306  {
307  default:
308  case vl::CF_CLEAR_COLOR_DEPTH_STENCIL: return "CF_CLEAR_COLOR_DEPTH_STENCIL";
309  case vl::CF_DO_NOT_CLEAR: return "CF_DO_NOT_CLEAR";
310  case vl::CF_CLEAR_COLOR: return "CF_CLEAR_COLOR";
311  case vl::CF_CLEAR_DEPTH: return "CF_CLEAR_DEPTH";
312  case vl::CF_CLEAR_STENCIL: return "CF_CLEAR_STENCIL";
313  case vl::CF_CLEAR_COLOR_DEPTH: return "CF_CLEAR_COLOR_DEPTH";
314  case vl::CF_CLEAR_COLOR_STENCIL: return "CF_CLEAR_COLOR_STENCIL";
315  case vl::CF_CLEAR_DEPTH_STENCIL: return "CF_CLEAR_DEPTH_STENCIL";
316  }
317  }
318 
320  {
321  if( value.getIdentifier() == "CF_DO_NOT_CLEAR") return vl::CF_DO_NOT_CLEAR;
322  if( value.getIdentifier() == "CF_CLEAR_COLOR") return vl::CF_CLEAR_COLOR;
323  if( value.getIdentifier() == "CF_CLEAR_DEPTH") return vl::CF_CLEAR_DEPTH;
324  if( value.getIdentifier() == "CF_CLEAR_STENCIL") return vl::CF_CLEAR_STENCIL;
325  if( value.getIdentifier() == "CF_CLEAR_COLOR_DEPTH") return vl::CF_CLEAR_COLOR_DEPTH;
326  if( value.getIdentifier() == "CF_CLEAR_COLOR_STENCIL") return vl::CF_CLEAR_COLOR_STENCIL;
327  if( value.getIdentifier() == "CF_CLEAR_DEPTH_STENCIL") return vl::CF_CLEAR_DEPTH_STENCIL;
328  if( value.getIdentifier() == "CF_CLEAR_COLOR_DEPTH_STENCIL") return vl::CF_CLEAR_COLOR_DEPTH_STENCIL;
329 
330  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
332  return vl::CF_DO_NOT_CLEAR;
333  }
334 
335  inline const char* vlx_EPolygonFace(vl::EPolygonFace pf)
336  {
337  switch(pf)
338  {
339  default:
340  case vl::PF_FRONT_AND_BACK: return "PF_FRONT_AND_BACK";
341  case vl::PF_FRONT: return "PF_FRONT";
342  case vl::PF_BACK: return "PF_BACK";
343  }
344  }
345 
347  {
348  if( value.getIdentifier() == "PF_FRONT") return vl::PF_FRONT;
349  if( value.getIdentifier() == "PF_BACK") return vl::PF_BACK;
350  if( value.getIdentifier() == "PF_FRONT_AND_BACK") return vl::PF_FRONT_AND_BACK;
351 
352  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
354  return vl::PF_FRONT_AND_BACK;
355  }
356 
357  inline const char* vlx_EColorMaterial(vl::EColorMaterial cm)
358  {
359  switch(cm)
360  {
361  default:
362  case vl::CM_AMBIENT_AND_DIFFUSE: return "CM_AMBIENT_AND_DIFFUSE";
363  case vl::CM_EMISSION: return "CM_EMISSION";
364  case vl::CM_AMBIENT: return "CM_AMBIENT";
365  case vl::CM_DIFFUSE: return "CM_DIFFUSE";
366  case vl::CM_SPECULAR: return "CM_SPECULAR";
367  }
368  }
369 
371  {
372  if( value.getIdentifier() == "CM_EMISSION") return vl::CM_EMISSION;
373  if( value.getIdentifier() == "CM_AMBIENT") return vl::CM_AMBIENT;
374  if( value.getIdentifier() == "CM_DIFFUSE") return vl::CM_DIFFUSE;
375  if( value.getIdentifier() == "CM_SPECULAR") return vl::CM_SPECULAR;
376  if( value.getIdentifier() == "CM_AMBIENT_AND_DIFFUSE") return vl::CM_AMBIENT_AND_DIFFUSE;
377 
378  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
381  }
382 
383  inline const char* vlx_ETextureFormat(vl::ETextureFormat tf)
384  {
385  switch(tf)
386  {
387  default:
388  case vl::TF_UNKNOWN: return "TF_UNKNOWN";
389 
390  case vl::TF_ALPHA : return "TF_ALPHA";
391  case vl::TF_ALPHA4 : return "TF_ALPHA4";
392  case vl::TF_ALPHA8 : return "TF_ALPHA8";
393  case vl::TF_ALPHA12: return "TF_ALPHA12";
394  case vl::TF_ALPHA16: return "TF_ALPHA16";
395 
396  case vl::TF_INTENSITY : return "TF_INTENSITY";
397  case vl::TF_INTENSITY4 : return "TF_INTENSITY4";
398  case vl::TF_INTENSITY8 : return "TF_INTENSITY8";
399  case vl::TF_INTENSITY12: return "TF_INTENSITY12";
400  case vl::TF_INTENSITY16: return "TF_INTENSITY16";
401  case vl::TF_LUMINANCE : return "TF_LUMINANCE";
402  case vl::TF_LUMINANCE4 : return "TF_LUMINANCE4";
403  case vl::TF_LUMINANCE8 : return "TF_LUMINANCE8";
404  case vl::TF_LUMINANCE12: return "TF_LUMINANCE12";
405  case vl::TF_LUMINANCE16: return "TF_LUMINANCE16";
406  case vl::TF_LUMINANCE_ALPHA : return "TF_LUMINANCE_ALPHA";
407  case vl::TF_LUMINANCE4_ALPHA4 : return "TF_LUMINANCE4_ALPHA4";
408  case vl::TF_LUMINANCE6_ALPHA2 : return "TF_LUMINANCE6_ALPHA2";
409  case vl::TF_LUMINANCE8_ALPHA8 : return "TF_LUMINANCE8_ALPHA8";
410  case vl::TF_LUMINANCE12_ALPHA4 : return "TF_LUMINANCE12_ALPHA4";
411  case vl::TF_LUMINANCE12_ALPHA12: return "TF_LUMINANCE12_ALPHA12";
412  case vl::TF_LUMINANCE16_ALPHA16: return "TF_LUMINANCE16_ALPHA16";
413  case vl::TF_R3_G3_B2: return "TF_R3_G3_B2";
414  case vl::TF_RGB : return "TF_RGB";
415  case vl::TF_RGB4 : return "TF_RGB4";
416  case vl::TF_RGB5 : return "TF_RGB5";
417  case vl::TF_RGB8 : return "TF_RGB8";
418  case vl::TF_RGB10 : return "TF_RGB10";
419  case vl::TF_RGB12 : return "TF_RGB12";
420  case vl::TF_RGB16 : return "TF_RGB16";
421  case vl::TF_RGBA : return "TF_RGBA";
422  case vl::TF_RGBA2 : return "TF_RGBA2";
423  case vl::TF_RGBA4 : return "TF_RGBA4";
424  case vl::TF_RGB5_A1 : return "TF_RGB5_A1";
425  case vl::TF_RGBA8 : return "TF_RGBA8";
426  case vl::TF_RGB10_A2: return "TF_RGB10_A2";
427  case vl::TF_RGBA12 : return "TF_RGBA12";
428  case vl::TF_RGBA16 : return "TF_RGBA16";
429 
430  // ARB_texture_float / OpenGL 3
431  case vl::TF_RGBA32F: return "TF_RGBA32F";
432  case vl::TF_RGB32F: return "TF_RGB32F";
433  case vl::TF_ALPHA32F: return "TF_ALPHA32F";
434  case vl::TF_INTENSITY32F: return "TF_INTENSITY32F";
435  case vl::TF_LUMINANCE32F: return "TF_LUMINANCE32F";
436  case vl::TF_LUMINANCE_ALPHA32F: return "TF_LUMINANCE_ALPHA32F";
437  case vl::TF_RGBA16F: return "TF_RGBA16F";
438  case vl::TF_RGB16F: return "TF_RGB16F";
439  case vl::TF_ALPHA16F: return "TF_ALPHA16F";
440  case vl::TF_INTENSITY16F: return "TF_INTENSITY16F";
441  case vl::TF_LUMINANCE16F: return "TF_LUMINANCE16F";
442  case vl::TF_LUMINANCE_ALPHA16F: return "TF_LUMINANCE_ALPHA16F";
443 
444  // from table 3.12 opengl api specs 4.1
445  case vl::TF_R8_SNORM: return "TF_R8_SNORM";
446  case vl::TF_R16_SNORM: return "TF_R16_SNORM";
447  case vl::TF_RG8_SNORM: return "TF_RG8_SNORM";
448  case vl::TF_RG16_SNORM: return "TF_RG16_SNORM";
449  case vl::TF_RGB8_SNORM: return "TF_RGB8_SNORM";
450  case vl::TF_RGBA8_SNORM: return "TF_RGBA8_SNORM";
451  case vl::TF_RGB10_A2UI: return "TF_RGB10_A2UI";
452  case vl::TF_RGBA16_SNORM: return "TF_RGBA16_SNORM";
453  case vl::TF_R11F_G11F_B10F: return "TF_R11F_G11F_B10F";
454  case vl::TF_RGB9_E5: return "TF_RGB9_E5";
455  case vl::TF_RGB8I: return "TF_RGB8I";
456  case vl::TF_RGB8UI: return "TF_RGB8UI";
457  case vl::TF_RGB16I: return "TF_RGB16I";
458  case vl::TF_RGB16UI: return "TF_RGB16UI";
459  case vl::TF_RGB32I: return "TF_RGB32I";
460  case vl::TF_RGB32UI: return "TF_RGB32UI";
461  case vl::TF_RGBA8I: return "TF_RGBA8I";
462  case vl::TF_RGBA8UI: return "TF_RGBA8UI";
463  case vl::TF_RGBA16I: return "TF_RGBA16I";
464  case vl::TF_RGBA16UI: return "TF_RGBA16UI";
465  case vl::TF_RGBA32I: return "TF_RGBA32I";
466  case vl::TF_RGBA32UI: return "TF_TF_RGBA32UI";
467 
468  // ATI_texture_float (the enums are the same as ARB_texture_float)
469  //case vl::TF_RGBA_FLOAT32_ATI: return "TF_RGBA_FLOAT32_ATI";
470  //case vl::TF_RGB_FLOAT32_ATI: return "TF_RGB_FLOAT32_ATI";
471  //case vl::TF_ALPHA_FLOAT32_ATI: return "TF_ALPHA_FLOAT32_ATI";
472  //case vl::TF_INTENSITY_FLOAT32_ATI: return "TF_INTENSITY_FLOAT32_ATI";
473  //case vl::TF_LUMINANCE_FLOAT32_ATI: return "TF_LUMINANCE_FLOAT32_ATI";
474  //case vl::TF_LUMINANCE_ALPHA_FLOAT32_ATI: return "TF_LUMINANCE_ALPHA_FLOAT32_ATI";
475  //case vl::TF_RGBA_FLOAT16_ATI: return "TF_RGBA_FLOAT16_ATI";
476  //case vl::TF_RGB_FLOAT16_ATI: return "TF_RGB_FLOAT16_ATI";
477  //case vl::TF_ALPHA_FLOAT16_ATI: return "TF_ALPHA_FLOAT16_ATI";
478  //case vl::TF_INTENSITY_FLOAT16_ATI: return "TF_INTENSITY_FLOAT16_ATI";
479  //case vl::TF_LUMINANCE_FLOAT16_ATI: return "TF_LUMINANCE_FLOAT16_ATI";
480  //case vl::TF_LUMINANCE_ALPHA_FLOAT16_ATI: return "TF_LUMINANCE_ALPHA_FLOAT16_ATI";
481 
482  // EXT_texture_shared_exponent
483  // case vl::TF_RGB9_E5_EXT: return "TF_RGB9_E5_EXT";
484 
485  // EXT_packed_float
486  // case vl::TF_11F_G11F_B10F_EXT: return "TF_11F_G11F_B10F_EXT";
487 
488  // EXT_packed_depth_stencil / GL_ARB_framebuffer_object
489  case vl::TF_DEPTH_STENCIL : return "TF_DEPTH_STENCIL";
490  case vl::TF_DEPTH24_STENCIL8: return "TF_DEPTH24_STENCIL8";
491 
492  // ARB_depth_buffer_float
493  case vl::TF_DEPTH_COMPONENT32F: return "TF_DEPTH_COMPONENT32F";
494  case vl::TF_DEPTH32F_STENCIL8 : return "TF_DEPTH32F_STENCIL8";
495 
496  // ARB_depth_texture
497  case vl::TF_DEPTH_COMPONENT : return "TF_DEPTH_COMPONENT";
498  case vl::TF_DEPTH_COMPONENT16: return "TF_DEPTH_COMPONENT16";
499  case vl::TF_DEPTH_COMPONENT24: return "TF_DEPTH_COMPONENT24";
500  case vl::TF_DEPTH_COMPONENT32: return "TF_DEPTH_COMPONENT32";
501 
502  // ARB_texture_compression
503  case vl::TF_COMPRESSED_ALPHA : return "TF_COMPRESSED_ALPHA";
504  case vl::TF_COMPRESSED_INTENSITY : return "TF_COMPRESSED_INTENSITY";
505  case vl::TF_COMPRESSED_LUMINANCE : return "TF_COMPRESSED_LUMINANCE";
506  case vl::TF_COMPRESSED_LUMINANCE_ALPHA: return "TF_COMPRESSED_LUMINANCE_ALPHA";
507  case vl::TF_COMPRESSED_RGB : return "TF_COMPRESSED_RGB";
508  case vl::TF_COMPRESSED_RGBA : return "TF_COMPRESSED_RGBA";
509 
510  // 3DFX_texture_compression_FXT1
511  case vl::TF_COMPRESSED_RGB_FXT1_3DFX : return "TF_COMPRESSED_RGB_FXT1_3DFX";
512  case vl::TF_COMPRESSED_RGBA_FXT1_3DFX: return "TF_COMPRESSED_RGBA_FXT1_3DFX";
513 
514  // EXT_texture_compression_s3tc
515  case vl::TF_COMPRESSED_RGB_S3TC_DXT1_EXT : return "TF_COMPRESSED_RGB_S3TC_DXT1_EXT";
516  case vl::TF_COMPRESSED_RGBA_S3TC_DXT1_EXT: return "TF_COMPRESSED_RGBA_S3TC_DXT1_EXT";
517  case vl::TF_COMPRESSED_RGBA_S3TC_DXT3_EXT: return "TF_COMPRESSED_RGBA_S3TC_DXT3_EXT";
518  case vl::TF_COMPRESSED_RGBA_S3TC_DXT5_EXT: return "TF_COMPRESSED_RGBA_S3TC_DXT5_EXT";
519 
520  // EXT_texture_compression_latc
521  case vl::TF_COMPRESSED_LUMINANCE_LATC1_EXT : return "TF_COMPRESSED_LUMINANCE_LATC1_EXT";
522  case vl::TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT : return "TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT";
523  case vl::TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT : return "TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT";
524  case vl::TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: return "TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT";
525 
526  // EXT_texture_compression_rgtc
527  case vl::TF_COMPRESSED_RED_RGTC1_EXT : return "TF_COMPRESSED_RED_RGTC1_EXT";
528  case vl::TF_COMPRESSED_SIGNED_RED_RGTC1_EXT : return "TF_COMPRESSED_SIGNED_RED_RGTC1_EXT";
529  case vl::TF_COMPRESSED_RED_GREEN_RGTC2_EXT : return "TF_COMPRESSED_RED_GREEN_RGTC2_EXT";
530  case vl::TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: return "TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT";
531 
532  // EXT_texture_integer
533  // case vl::TF_RGBA32UI_EXT: return "TF_RGBA32UI_EXT";
534  // case vl::TF_RGB32UI_EXT: return "TF_RGB32UI_EXT";
535  case vl::TF_ALPHA32UI_EXT: return "TF_ALPHA32UI_EXT";
536  case vl::TF_INTENSITY32UI_EXT: return "TF_INTENSITY32UI_EXT";
537  case vl::TF_LUMINANCE32UI_EXT: return "TF_LUMINANCE32UI_EXT";
538  case vl::TF_LUMINANCE_ALPHA32UI_EXT: return "TF_LUMINANCE_ALPHA32UI_EXT";
539 
540  // case vl::TF_RGBA16UI_EXT: return "TF_RGBA16UI_EXT";
541  // case vl::TF_RGB16UI_EXT: return "TF_RGB16UI_EXT";
542  case vl::TF_ALPHA16UI_EXT: return "TF_ALPHA16UI_EXT";
543  case vl::TF_INTENSITY16UI_EXT: return "TF_INTENSITY16UI_EXT";
544  case vl::TF_LUMINANCE16UI_EXT: return "TF_LUMINANCE16UI_EXT";
545  case vl::TF_LUMINANCE_ALPHA16UI_EXT: return "TF_LUMINANCE_ALPHA16UI_EXT";
546 
547  // case vl::TF_RGBA8UI_EXT: return "TF_RGBA8UI_EXT";
548  // case vl::TF_RGB8UI_EXT: return "TF_RGB8UI_EXT";
549  case vl::TF_ALPHA8UI_EXT: return "TF_ALPHA8UI_EXT";
550  case vl::TF_INTENSITY8UI_EXT: return "TF_INTENSITY8UI_EXT";
551  case vl::TF_LUMINANCE8UI_EXT: return "TF_LUMINANCE8UI_EXT";
552  case vl::TF_LUMINANCE_ALPHA8UI_EXT: return "TF_LUMINANCE_ALPHA8UI_EXT";
553 
554  // case vl::TF_RGBA32I_EXT: return "TF_RGBA32I_EXT";
555  // case vl::TF_RGB32I_EXT: return "TF_RGB32I_EXT";
556  case vl::TF_ALPHA32I_EXT: return "TF_ALPHA32I_EXT";
557  case vl::TF_INTENSITY32I_EXT: return "TF_INTENSITY32I_EXT";
558  case vl::TF_LUMINANCE32I_EXT: return "TF_LUMINANCE32I_EXT";
559  case vl::TF_LUMINANCE_ALPHA32I_EXT: return "TF_LUMINANCE_ALPHA32I_EXT";
560 
561  // case vl::TF_RGBA16I_EXT: return "TF_RGBA16I_EXT";
562  // case vl::TF_RGB16I_EXT: return "TF_RGB16I_EXT";
563  case vl::TF_ALPHA16I_EXT: return "TF_ALPHA16I_EXT";
564  case vl::TF_INTENSITY16I_EXT: return "TF_INTENSITY16I_EXT";
565  case vl::TF_LUMINANCE16I_EXT: return "TF_LUMINANCE16I_EXT";
566  case vl::TF_LUMINANCE_ALPHA16I_EXT: return "TF_LUMINANCE_ALPHA16I_EXT";
567 
568  // case vl::TF_RGBA8I_EXT: return "TF_RGBA8I_EXT";
569  // case vl::TF_RGB8I_EXT: return "TF_RGB8I_EXT";
570  case vl::TF_ALPHA8I_EXT: return "TF_ALPHA8I_EXT";
571  case vl::TF_INTENSITY8I_EXT: return "TF_INTENSITY8I_EXT";
572  case vl::TF_LUMINANCE8I_EXT: return "TF_LUMINANCE8I_EXT";
573  case vl::TF_LUMINANCE_ALPHA8I_EXT: return "TF_LUMINANCE_ALPHA8I_EXT";
574 
575  // GL_ARB_texture_rg
576  case vl::TF_RED: return "TF_RED";
577  case vl::TF_COMPRESSED_RED: return "TF_COMPRESSED_RED";
578  case vl::TF_COMPRESSED_RG: return "TF_COMPRESSED_RG";
579  case vl::TF_RG: return "TF_RG";
580  case vl::TF_R8: return "TF_R8";
581  case vl::TF_R16: return "TF_R16";
582  case vl::TF_RG8: return "TF_RG8";
583  case vl::TF_RG16: return "TF_RG16";
584  case vl::TF_R16F: return "TF_R16F";
585  case vl::TF_R32F: return "TF_R32F";
586  case vl::TF_RG16F: return "TF_RG16F";
587  case vl::TF_RG32F: return "TF_RG32F";
588  case vl::TF_R8I: return "TF_R8I";
589  case vl::TF_R8UI: return "TF_R8UI";
590  case vl::TF_R16I: return "TF_R16I";
591  case vl::TF_R16UI: return "TF_R16UI";
592  case vl::TF_R32I: return "TF_R32I";
593  case vl::TF_R32UI: return "TF_R32UI";
594  case vl::TF_RG8I: return "TF_RG8I";
595  case vl::TF_RG8UI: return "TF_RG8UI";
596  case vl::TF_RG16I: return "TF_RG16I";
597  case vl::TF_RG16UI: return "TF_RG16UI";
598  case vl::TF_RG32I: return "TF_RG32I";
599  case vl::TF_RG32UI: return "TF_RG32UI";
600 
601  // sRGB OpenGL 2.1
602  case vl::TF_SLUMINANCE_ALPHA: return "TF_SLUMINANCE_ALPHA";
603  case vl::TF_SLUMINANCE8_ALPHA8: return "TF_SLUMINANCE8_ALPHA8";
604  case vl::TF_SLUMINANCE: return "TF_SLUMINANCE";
605  case vl::TF_SLUMINANCE8: return "TF_SLUMINANCE8";
606  case vl::TF_COMPRESSED_SLUMINANCE: return "TF_COMPRESSED_SLUMINANCE";
607  case vl::TF_COMPRESSED_SLUMINANCE_ALPHA: return "TF_COMPRESSED_SLUMINANCE_ALPHA";
608 
609  // sRGB OpenGL 2.1 / 3.x
610  case vl::TF_SRGB: return "TF_SRGB";
611  case vl::TF_SRGB8: return "TF_SRGB8";
612  case vl::TF_SRGB_ALPHA: return "TF_SRGB_ALPHA";
613  case vl::TF_SRGB8_ALPHA8: return "TF_SRGB8_ALPHA8";
614  case vl::TF_COMPRESSED_SRGB: return "TF_COMPRESSED_SRGB";
615  case vl::TF_COMPRESSED_SRGB_ALPHA: return "TF_COMPRESSED_SRGB_ALPHA";
616 
617  // GL_EXT_texture_sRGB compressed formats
618  case vl::TF_COMPRESSED_SRGB_S3TC_DXT1_EXT: return "TF_COMPRESSED_SRGB_S3TC_DXT1_EXT";
619  case vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT";
620  case vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT";
621  case vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT";
622  }
623  }
624 
626  {
627  if( value.getIdentifier() == "TF_UNKNOWN") return vl::TF_UNKNOWN;
628 
629  if( value.getIdentifier() == "TF_ALPHA") return vl::TF_ALPHA;
630  if( value.getIdentifier() == "TF_ALPHA4") return vl::TF_ALPHA4;
631  if( value.getIdentifier() == "TF_ALPHA8") return vl::TF_ALPHA8;
632  if( value.getIdentifier() == "TF_ALPHA12") return vl::TF_ALPHA12;
633  if( value.getIdentifier() == "TF_ALPHA16") return vl::TF_ALPHA16;
634 
635  if( value.getIdentifier() == "TF_INTENSITY") return vl::TF_INTENSITY;
636  if( value.getIdentifier() == "TF_INTENSITY4") return vl::TF_INTENSITY4;
637  if( value.getIdentifier() == "TF_INTENSITY8") return vl::TF_INTENSITY8;
638  if( value.getIdentifier() == "TF_INTENSITY12") return vl::TF_INTENSITY12;
639  if( value.getIdentifier() == "TF_INTENSITY16") return vl::TF_INTENSITY16;
640  if( value.getIdentifier() == "TF_LUMINANCE") return vl::TF_LUMINANCE;
641  if( value.getIdentifier() == "TF_LUMINANCE4") return vl::TF_LUMINANCE4;
642  if( value.getIdentifier() == "TF_LUMINANCE8") return vl::TF_LUMINANCE8;
643  if( value.getIdentifier() == "TF_LUMINANCE12") return vl::TF_LUMINANCE12;
644  if( value.getIdentifier() == "TF_LUMINANCE16") return vl::TF_LUMINANCE16;
645  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA") return vl::TF_LUMINANCE_ALPHA;
646  if( value.getIdentifier() == "TF_LUMINANCE4_ALPHA4") return vl::TF_LUMINANCE4_ALPHA4;
647  if( value.getIdentifier() == "TF_LUMINANCE6_ALPHA2") return vl::TF_LUMINANCE6_ALPHA2;
648  if( value.getIdentifier() == "TF_LUMINANCE8_ALPHA8") return vl::TF_LUMINANCE8_ALPHA8;
649  if( value.getIdentifier() == "TF_LUMINANCE12_ALPHA4") return vl::TF_LUMINANCE12_ALPHA4;
650  if( value.getIdentifier() == "TF_LUMINANCE12_ALPHA12") return vl::TF_LUMINANCE12_ALPHA12;
651  if( value.getIdentifier() == "TF_LUMINANCE16_ALPHA16") return vl::TF_LUMINANCE16_ALPHA16;
652  if( value.getIdentifier() == "TF_R3_G3_B2") return vl::TF_R3_G3_B2;
653  if( value.getIdentifier() == "TF_RGB") return vl::TF_RGB;
654  if( value.getIdentifier() == "TF_RGB4") return vl::TF_RGB4;
655  if( value.getIdentifier() == "TF_RGB5") return vl::TF_RGB5;
656  if( value.getIdentifier() == "TF_RGB8") return vl::TF_RGB8;
657  if( value.getIdentifier() == "TF_RGB10") return vl::TF_RGB10;
658  if( value.getIdentifier() == "TF_RGB12") return vl::TF_RGB12;
659  if( value.getIdentifier() == "TF_RGB16") return vl::TF_RGB16;
660  if( value.getIdentifier() == "TF_RGBA") return vl::TF_RGBA;
661  if( value.getIdentifier() == "TF_RGBA2") return vl::TF_RGBA2;
662  if( value.getIdentifier() == "TF_RGBA4") return vl::TF_RGBA4;
663  if( value.getIdentifier() == "TF_RGB5_A1") return vl::TF_RGB5_A1;
664  if( value.getIdentifier() == "TF_RGBA8") return vl::TF_RGBA8;
665  if( value.getIdentifier() == "TF_RGB10_A2") return vl::TF_RGB10_A2;
666  if( value.getIdentifier() == "TF_RGBA12") return vl::TF_RGBA12;
667  if( value.getIdentifier() == "TF_RGBA16") return vl::TF_RGBA16;
668 
669  // ARB_texture_float / OpenGL 3
670  if( value.getIdentifier() == "TF_RGBA32F") return vl::TF_RGBA32F;
671  if( value.getIdentifier() == "TF_RGB32F") return vl::TF_RGB32F;
672  if( value.getIdentifier() == "TF_ALPHA32F") return vl::TF_ALPHA32F;
673  if( value.getIdentifier() == "TF_INTENSITY32F") return vl::TF_INTENSITY32F;
674  if( value.getIdentifier() == "TF_LUMINANCE32F") return vl::TF_LUMINANCE32F;
675  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA32F") return vl::TF_LUMINANCE_ALPHA32F;
676  if( value.getIdentifier() == "TF_RGBA16F") return vl::TF_RGBA16F;
677  if( value.getIdentifier() == "TF_RGB16F") return vl::TF_RGB16F;
678  if( value.getIdentifier() == "TF_ALPHA16F") return vl::TF_ALPHA16F;
679  if( value.getIdentifier() == "TF_INTENSITY16F") return vl::TF_INTENSITY16F;
680  if( value.getIdentifier() == "TF_LUMINANCE16F") return vl::TF_LUMINANCE16F;
681  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA16F") return vl::TF_LUMINANCE_ALPHA16F;
682 
683  // from table 3.12 opengl api specs 4.1
684  if( value.getIdentifier() == "TF_R8_SNORM") return vl::TF_R8_SNORM;
685  if( value.getIdentifier() == "TF_R16_SNORM") return vl::TF_R16_SNORM;
686  if( value.getIdentifier() == "TF_RG8_SNORM") return vl::TF_RG8_SNORM;
687  if( value.getIdentifier() == "TF_RG16_SNORM") return vl::TF_RG16_SNORM;
688  if( value.getIdentifier() == "TF_RGB8_SNORM") return vl::TF_RGB8_SNORM;
689  if( value.getIdentifier() == "TF_RGBA8_SNORM") return vl::TF_RGBA8_SNORM;
690  if( value.getIdentifier() == "TF_RGB10_A2UI") return vl::TF_RGB10_A2UI;
691  if( value.getIdentifier() == "TF_RGBA16_SNORM") return vl::TF_RGBA16_SNORM;
692  if( value.getIdentifier() == "TF_R11F_G11F_B10F") return vl::TF_R11F_G11F_B10F;
693  if( value.getIdentifier() == "TF_RGB9_E5") return vl::TF_RGB9_E5;
694  if( value.getIdentifier() == "TF_RGB8I") return vl::TF_RGB8I;
695  if( value.getIdentifier() == "TF_RGB8UI") return vl::TF_RGB8UI;
696  if( value.getIdentifier() == "TF_RGB16I") return vl::TF_RGB16I;
697  if( value.getIdentifier() == "TF_RGB16UI") return vl::TF_RGB16UI;
698  if( value.getIdentifier() == "TF_RGB32I") return vl::TF_RGB32I;
699  if( value.getIdentifier() == "TF_RGB32UI") return vl::TF_RGB32UI;
700  if( value.getIdentifier() == "TF_RGBA8I") return vl::TF_RGBA8I;
701  if( value.getIdentifier() == "TF_RGBA8UI") return vl::TF_RGBA8UI;
702  if( value.getIdentifier() == "TF_RGBA16I") return vl::TF_RGBA16I;
703  if( value.getIdentifier() == "TF_RGBA16UI") return vl::TF_RGBA16UI;
704  if( value.getIdentifier() == "TF_RGBA32I") return vl::TF_RGBA32I;
705  if( value.getIdentifier() == "TF_RGBA32UI") return vl::TF_RGBA32UI;
706 
707  // ATI_texture_float (the enums are the same as ARB_texture_float)
708  if( value.getIdentifier() == "TF_RGBA_FLOAT32_ATI") return vl::TF_RGBA_FLOAT32_ATI;
709  if( value.getIdentifier() == "TF_RGB_FLOAT32_ATI") return vl::TF_RGB_FLOAT32_ATI;
710  if( value.getIdentifier() == "TF_ALPHA_FLOAT32_ATI") return vl::TF_ALPHA_FLOAT32_ATI;
711  if( value.getIdentifier() == "TF_INTENSITY_FLOAT32_ATI") return vl::TF_INTENSITY_FLOAT32_ATI;
712  if( value.getIdentifier() == "TF_LUMINANCE_FLOAT32_ATI") return vl::TF_LUMINANCE_FLOAT32_ATI;
713  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA_FLOAT32_ATI") return vl::TF_LUMINANCE_ALPHA_FLOAT32_ATI;
714  if( value.getIdentifier() == "TF_RGBA_FLOAT16_ATI") return vl::TF_RGBA_FLOAT16_ATI;
715  if( value.getIdentifier() == "TF_RGB_FLOAT16_ATI") return vl::TF_RGB_FLOAT16_ATI;
716  if( value.getIdentifier() == "TF_ALPHA_FLOAT16_ATI") return vl::TF_ALPHA_FLOAT16_ATI;
717  if( value.getIdentifier() == "TF_INTENSITY_FLOAT16_ATI") return vl::TF_INTENSITY_FLOAT16_ATI;
718  if( value.getIdentifier() == "TF_LUMINANCE_FLOAT16_ATI") return vl::TF_LUMINANCE_FLOAT16_ATI;
719  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA_FLOAT16_ATI") return vl::TF_LUMINANCE_ALPHA_FLOAT16_ATI;
720 
721  // EXT_texture_shared_exponent
722  if( value.getIdentifier() == "TF_RGB9_E5_EXT") return vl::TF_RGB9_E5_EXT;
723 
724  // EXT_packed_float
725  if( value.getIdentifier() == "TF_11F_G11F_B10F_EXT") return vl::TF_11F_G11F_B10F_EXT;
726 
727  // EXT_packed_depth_stencil / GL_ARB_framebuffer_object
728  if( value.getIdentifier() == "TF_DEPTH_STENCIL") return vl::TF_DEPTH_STENCIL;
729  if( value.getIdentifier() == "TF_DEPTH24_STENCIL8") return vl::TF_DEPTH24_STENCIL8;
730 
731  // ARB_depth_buffer_float
732  if( value.getIdentifier() == "TF_DEPTH_COMPONENT32F") return vl::TF_DEPTH_COMPONENT32F;
733  if( value.getIdentifier() == "TF_DEPTH32F_STENCIL8") return vl::TF_DEPTH32F_STENCIL8;
734 
735  // ARB_depth_texture
736  if( value.getIdentifier() == "TF_DEPTH_COMPONENT") return vl::TF_DEPTH_COMPONENT;
737  if( value.getIdentifier() == "TF_DEPTH_COMPONENT16") return vl::TF_DEPTH_COMPONENT16;
738  if( value.getIdentifier() == "TF_DEPTH_COMPONENT24") return vl::TF_DEPTH_COMPONENT24;
739  if( value.getIdentifier() == "TF_DEPTH_COMPONENT32") return vl::TF_DEPTH_COMPONENT32;
740 
741  // ARB_texture_compression
742  if( value.getIdentifier() == "TF_COMPRESSED_ALPHA") return vl::TF_COMPRESSED_ALPHA;
743  if( value.getIdentifier() == "TF_COMPRESSED_INTENSITY") return vl::TF_COMPRESSED_INTENSITY;
744  if( value.getIdentifier() == "TF_COMPRESSED_LUMINANCE") return vl::TF_COMPRESSED_LUMINANCE;
745  if( value.getIdentifier() == "TF_COMPRESSED_LUMINANCE_ALPHA") return vl::TF_COMPRESSED_LUMINANCE_ALPHA;
746  if( value.getIdentifier() == "TF_COMPRESSED_RGB") return vl::TF_COMPRESSED_RGB;
747  if( value.getIdentifier() == "TF_COMPRESSED_RGBA") return vl::TF_COMPRESSED_RGBA;
748 
749  // 3DFX_texture_compression_FXT1
750  if( value.getIdentifier() == "TF_COMPRESSED_RGB_FXT1_3DFX") return vl::TF_COMPRESSED_RGB_FXT1_3DFX;
751  if( value.getIdentifier() == "TF_COMPRESSED_RGBA_FXT1_3DFX") return vl::TF_COMPRESSED_RGBA_FXT1_3DFX;
752 
753  // EXT_texture_compression_s3tc
754  if( value.getIdentifier() == "TF_COMPRESSED_RGB_S3TC_DXT1_EXT") return vl::TF_COMPRESSED_RGB_S3TC_DXT1_EXT;
755  if( value.getIdentifier() == "TF_COMPRESSED_RGBA_S3TC_DXT1_EXT") return vl::TF_COMPRESSED_RGBA_S3TC_DXT1_EXT;
756  if( value.getIdentifier() == "TF_COMPRESSED_RGBA_S3TC_DXT3_EXT") return vl::TF_COMPRESSED_RGBA_S3TC_DXT3_EXT;
757  if( value.getIdentifier() == "TF_COMPRESSED_RGBA_S3TC_DXT5_EXT") return vl::TF_COMPRESSED_RGBA_S3TC_DXT5_EXT;
758 
759  // EXT_texture_compression_latc
760  if( value.getIdentifier() == "TF_COMPRESSED_LUMINANCE_LATC1_EXT") return vl::TF_COMPRESSED_LUMINANCE_LATC1_EXT;
761  if( value.getIdentifier() == "TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT") return vl::TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT;
762  if( value.getIdentifier() == "TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT") return vl::TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT;
763  if( value.getIdentifier() == "TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT") return vl::TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT;
764 
765  // EXT_texture_compression_rgtc
766  if( value.getIdentifier() == "TF_COMPRESSED_RED_RGTC1_EXT") return vl::TF_COMPRESSED_RED_RGTC1_EXT;
767  if( value.getIdentifier() == "TF_COMPRESSED_SIGNED_RED_RGTC1_EXT") return vl::TF_COMPRESSED_SIGNED_RED_RGTC1_EXT;
768  if( value.getIdentifier() == "TF_COMPRESSED_RED_GREEN_RGTC2_EXT") return vl::TF_COMPRESSED_RED_GREEN_RGTC2_EXT;
769  if( value.getIdentifier() == "TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT") return vl::TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
770 
771  // EXT_texture_integer
772  if( value.getIdentifier() == "TF_RGBA32UI_EXT") return vl::TF_RGBA32UI_EXT;
773  if( value.getIdentifier() == "TF_RGB32UI_EXT") return vl::TF_RGB32UI_EXT;
774  if( value.getIdentifier() == "TF_ALPHA32UI_EXT") return vl::TF_ALPHA32UI_EXT;
775  if( value.getIdentifier() == "TF_INTENSITY32UI_EXT") return vl::TF_INTENSITY32UI_EXT;
776  if( value.getIdentifier() == "TF_LUMINANCE32UI_EXT") return vl::TF_LUMINANCE32UI_EXT;
777  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA32UI_EXT") return vl::TF_LUMINANCE_ALPHA32UI_EXT;
778 
779  if( value.getIdentifier() == "TF_RGBA16UI_EXT") return vl::TF_RGBA16UI_EXT;
780  if( value.getIdentifier() == "TF_RGB16UI_EXT") return vl::TF_RGB16UI_EXT;
781  if( value.getIdentifier() == "TF_ALPHA16UI_EXT") return vl::TF_ALPHA16UI_EXT;
782  if( value.getIdentifier() == "TF_INTENSITY16UI_EXT") return vl::TF_INTENSITY16UI_EXT;
783  if( value.getIdentifier() == "TF_LUMINANCE16UI_EXT") return vl::TF_LUMINANCE16UI_EXT;
784  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA16UI_EXT") return vl::TF_LUMINANCE_ALPHA16UI_EXT;
785 
786  if( value.getIdentifier() == "TF_RGBA8UI_EXT") return vl::TF_RGBA8UI_EXT;
787  if( value.getIdentifier() == "TF_RGB8UI_EXT") return vl::TF_RGB8UI_EXT;
788  if( value.getIdentifier() == "TF_ALPHA8UI_EXT") return vl::TF_ALPHA8UI_EXT;
789  if( value.getIdentifier() == "TF_INTENSITY8UI_EXT") return vl::TF_INTENSITY8UI_EXT;
790  if( value.getIdentifier() == "TF_LUMINANCE8UI_EXT") return vl::TF_LUMINANCE8UI_EXT;
791  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA8UI_EXT") return vl::TF_LUMINANCE_ALPHA8UI_EXT;
792 
793  if( value.getIdentifier() == "TF_RGBA32I_EXT") return vl::TF_RGBA32I_EXT;
794  if( value.getIdentifier() == "TF_RGB32I_EXT") return vl::TF_RGB32I_EXT;
795  if( value.getIdentifier() == "TF_ALPHA32I_EXT") return vl::TF_ALPHA32I_EXT;
796  if( value.getIdentifier() == "TF_INTENSITY32I_EXT") return vl::TF_INTENSITY32I_EXT;
797  if( value.getIdentifier() == "TF_LUMINANCE32I_EXT") return vl::TF_LUMINANCE32I_EXT;
798  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA32I_EXT") return vl::TF_LUMINANCE_ALPHA32I_EXT;
799 
800  if( value.getIdentifier() == "TF_RGBA16I_EXT") return vl::TF_RGBA16I_EXT;
801  if( value.getIdentifier() == "TF_RGB16I_EXT") return vl::TF_RGB16I_EXT;
802  if( value.getIdentifier() == "TF_ALPHA16I_EXT") return vl::TF_ALPHA16I_EXT;
803  if( value.getIdentifier() == "TF_INTENSITY16I_EXT") return vl::TF_INTENSITY16I_EXT;
804  if( value.getIdentifier() == "TF_LUMINANCE16I_EXT") return vl::TF_LUMINANCE16I_EXT;
805  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA16I_EXT") return vl::TF_LUMINANCE_ALPHA16I_EXT;
806 
807  if( value.getIdentifier() == "TF_RGBA8I_EXT") return vl::TF_RGBA8I_EXT;
808  if( value.getIdentifier() == "TF_RGB8I_EXT") return vl::TF_RGB8I_EXT;
809  if( value.getIdentifier() == "TF_ALPHA8I_EXT") return vl::TF_ALPHA8I_EXT;
810  if( value.getIdentifier() == "TF_INTENSITY8I_EXT") return vl::TF_INTENSITY8I_EXT;
811  if( value.getIdentifier() == "TF_LUMINANCE8I_EXT") return vl::TF_LUMINANCE8I_EXT;
812  if( value.getIdentifier() == "TF_LUMINANCE_ALPHA8I_EXT") return vl::TF_LUMINANCE_ALPHA8I_EXT;
813 
814  // GL_ARB_texture_rg
815  if( value.getIdentifier() == "TF_RED") return vl::TF_RED;
816  if( value.getIdentifier() == "TF_COMPRESSED_RED") return vl::TF_COMPRESSED_RED;
817  if( value.getIdentifier() == "TF_COMPRESSED_RG") return vl::TF_COMPRESSED_RG;
818  if( value.getIdentifier() == "TF_RG") return vl::TF_RG;
819  if( value.getIdentifier() == "TF_R8") return vl::TF_R8;
820  if( value.getIdentifier() == "TF_R16") return vl::TF_R16;
821  if( value.getIdentifier() == "TF_RG8") return vl::TF_RG8;
822  if( value.getIdentifier() == "TF_RG16") return vl::TF_RG16;
823  if( value.getIdentifier() == "TF_R16F") return vl::TF_R16F;
824  if( value.getIdentifier() == "TF_R32F") return vl::TF_R32F;
825  if( value.getIdentifier() == "TF_RG16F") return vl::TF_RG16F;
826  if( value.getIdentifier() == "TF_RG32F") return vl::TF_RG32F;
827  if( value.getIdentifier() == "TF_R8I") return vl::TF_R8I;
828  if( value.getIdentifier() == "TF_R8UI") return vl::TF_R8UI;
829  if( value.getIdentifier() == "TF_R16I") return vl::TF_R16I;
830  if( value.getIdentifier() == "TF_R16UI") return vl::TF_R16UI;
831  if( value.getIdentifier() == "TF_R32I") return vl::TF_R32I;
832  if( value.getIdentifier() == "TF_R32UI") return vl::TF_R32UI;
833  if( value.getIdentifier() == "TF_RG8I") return vl::TF_RG8I;
834  if( value.getIdentifier() == "TF_RG8UI") return vl::TF_RG8UI;
835  if( value.getIdentifier() == "TF_RG16I") return vl::TF_RG16I;
836  if( value.getIdentifier() == "TF_RG16UI") return vl::TF_RG16UI;
837  if( value.getIdentifier() == "TF_RG32I") return vl::TF_RG32I;
838  if( value.getIdentifier() == "TF_RG32UI") return vl::TF_RG32UI;
839 
840  // sRGB OpenGL 2.1
841  if( value.getIdentifier() == "TF_SLUMINANCE_ALPHA") return vl::TF_SLUMINANCE_ALPHA;
842  if( value.getIdentifier() == "TF_SLUMINANCE8_ALPHA8") return vl::TF_SLUMINANCE8_ALPHA8;
843  if( value.getIdentifier() == "TF_SLUMINANCE") return vl::TF_SLUMINANCE;
844  if( value.getIdentifier() == "TF_SLUMINANCE8") return vl::TF_SLUMINANCE8;
845  if( value.getIdentifier() == "TF_COMPRESSED_SLUMINANCE") return vl::TF_COMPRESSED_SLUMINANCE;
846  if( value.getIdentifier() == "TF_COMPRESSED_SLUMINANCE_ALPHA") return vl::TF_COMPRESSED_SLUMINANCE_ALPHA;
847 
848  // sRGB OpenGL 2.1 / 3.x
849  if( value.getIdentifier() == "TF_SRGB") return vl::TF_SRGB;
850  if( value.getIdentifier() == "TF_SRGB8") return vl::TF_SRGB8;
851  if( value.getIdentifier() == "TF_SRGB_ALPHA") return vl::TF_SRGB_ALPHA;
852  if( value.getIdentifier() == "TF_SRGB8_ALPHA8") return vl::TF_SRGB8_ALPHA8;
853  if( value.getIdentifier() == "TF_COMPRESSED_SRGB") return vl::TF_COMPRESSED_SRGB;
854  if( value.getIdentifier() == "TF_COMPRESSED_SRGB_ALPHA") return vl::TF_COMPRESSED_SRGB_ALPHA;
855 
856  // GL_EXT_texture_sRGB compressed formats
857  if( value.getIdentifier() == "TF_COMPRESSED_SRGB_S3TC_DXT1_EXT") return vl::TF_COMPRESSED_SRGB_S3TC_DXT1_EXT;
858  if( value.getIdentifier() == "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT") return vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
859  if( value.getIdentifier() == "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT") return vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
860  if( value.getIdentifier() == "TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT") return vl::TF_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
861 
862  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
864  return vl::TF_UNKNOWN;
865  }
866 
867  inline const char* vlx_EUniformType(vl::EUniformType type)
868  {
869  switch(type)
870  {
871  default:
872  return "UT_NONE";
873 
874  case vl::UT_INT: return "UT_INT";
875  case vl::UT_INT_VEC2: return "UT_INT_VEC2";
876  case vl::UT_INT_VEC3: return "UT_INT_VEC3";
877  case vl::UT_INT_VEC4: return "UT_INT_VEC4";
878 
879  case vl::UT_UNSIGNED_INT: return "UT_UNSIGNED_INT";
880  case vl::UT_UNSIGNED_INT_VEC2: return "UT_UNSIGNED_INT_VEC2";
881  case vl::UT_UNSIGNED_INT_VEC3: return "UT_UNSIGNED_INT_VEC3";
882  case vl::UT_UNSIGNED_INT_VEC4: return "UT_UNSIGNED_INT_VEC4";
883 
884  case vl::UT_FLOAT: return "UT_FLOAT";
885  case vl::UT_FLOAT_VEC2: return "UT_FLOAT_VEC2";
886  case vl::UT_FLOAT_VEC3: return "UT_FLOAT_VEC3";
887  case vl::UT_FLOAT_VEC4: return "UT_FLOAT_VEC4";
888 
889  case vl::UT_FLOAT_MAT2: return "UT_FLOAT_MAT2";
890  case vl::UT_FLOAT_MAT3: return "UT_FLOAT_MAT3";
891  case vl::UT_FLOAT_MAT4: return "UT_FLOAT_MAT4";
892 
893  case vl::UT_FLOAT_MAT2x3: return "UT_FLOAT_MAT2x3";
894  case vl::UT_FLOAT_MAT3x2: return "UT_FLOAT_MAT3x2";
895  case vl::UT_FLOAT_MAT2x4: return "UT_FLOAT_MAT2x4";
896  case vl::UT_FLOAT_MAT4x2: return "UT_FLOAT_MAT4x2";
897  case vl::UT_FLOAT_MAT3x4: return "UT_FLOAT_MAT3x4";
898  case vl::UT_FLOAT_MAT4x3: return "UT_FLOAT_MAT4x3";
899 
900  case vl::UT_DOUBLE: return "UT_DOUBLE";
901  case vl::UT_DOUBLE_VEC2: return "UT_DOUBLE_VEC2";
902  case vl::UT_DOUBLE_VEC3: return "UT_DOUBLE_VEC3";
903  case vl::UT_DOUBLE_VEC4: return "UT_DOUBLE_VEC4";
904 
905  case vl::UT_DOUBLE_MAT2: return "UT_DOUBLE_MAT2";
906  case vl::UT_DOUBLE_MAT3: return "UT_DOUBLE_MAT3";
907  case vl::UT_DOUBLE_MAT4: return "UT_DOUBLE_MAT4";
908 
909  case vl::UT_DOUBLE_MAT2x3: return "UT_DOUBLE_MAT2x3";
910  case vl::UT_DOUBLE_MAT3x2: return "UT_DOUBLE_MAT3x2";
911  case vl::UT_DOUBLE_MAT2x4: return "UT_DOUBLE_MAT2x4";
912  case vl::UT_DOUBLE_MAT4x2: return "UT_DOUBLE_MAT4x2";
913  case vl::UT_DOUBLE_MAT3x4: return "UT_DOUBLE_MAT3x4";
914  case vl::UT_DOUBLE_MAT4x3: return "UT_DOUBLE_MAT4x3";
915  }
916  }
917 
919  {
920  if( value.getIdentifier() == "UT_INT") return vl::UT_INT;
921  if( value.getIdentifier() == "UT_INT_VEC2") return vl::UT_INT_VEC2;
922  if( value.getIdentifier() == "UT_INT_VEC3") return vl::UT_INT_VEC3;
923  if( value.getIdentifier() == "UT_INT_VEC4") return vl::UT_INT_VEC4;
924 
925  if( value.getIdentifier() == "UT_UNSIGNED_INT") return vl::UT_UNSIGNED_INT;
926  if( value.getIdentifier() == "UT_UNSIGNED_INT_VEC2") return vl::UT_UNSIGNED_INT_VEC2;
927  if( value.getIdentifier() == "UT_UNSIGNED_INT_VEC3") return vl::UT_UNSIGNED_INT_VEC3;
928  if( value.getIdentifier() == "UT_UNSIGNED_INT_VEC4") return vl::UT_UNSIGNED_INT_VEC4;
929 
930  if( value.getIdentifier() == "UT_FLOAT") return vl::UT_FLOAT;
931  if( value.getIdentifier() == "UT_FLOAT_VEC2") return vl::UT_FLOAT_VEC2;
932  if( value.getIdentifier() == "UT_FLOAT_VEC3") return vl::UT_FLOAT_VEC3;
933  if( value.getIdentifier() == "UT_FLOAT_VEC4") return vl::UT_FLOAT_VEC4;
934 
935  if( value.getIdentifier() == "UT_FLOAT_MAT2") return vl::UT_FLOAT_MAT2;
936  if( value.getIdentifier() == "UT_FLOAT_MAT3") return vl::UT_FLOAT_MAT3;
937  if( value.getIdentifier() == "UT_FLOAT_MAT4") return vl::UT_FLOAT_MAT4;
938 
939  if( value.getIdentifier() == "UT_FLOAT_MAT2x3") return vl::UT_FLOAT_MAT2x3;
940  if( value.getIdentifier() == "UT_FLOAT_MAT3x2") return vl::UT_FLOAT_MAT3x2;
941  if( value.getIdentifier() == "UT_FLOAT_MAT2x4") return vl::UT_FLOAT_MAT2x4;
942  if( value.getIdentifier() == "UT_FLOAT_MAT4x2") return vl::UT_FLOAT_MAT4x2;
943  if( value.getIdentifier() == "UT_FLOAT_MAT3x4") return vl::UT_FLOAT_MAT3x4;
944  if( value.getIdentifier() == "UT_FLOAT_MAT4x3") return vl::UT_FLOAT_MAT4x3;
945 
946  if( value.getIdentifier() == "UT_DOUBLE") return vl::UT_DOUBLE;
947  if( value.getIdentifier() == "UT_DOUBLE_VEC2") return vl::UT_DOUBLE_VEC2;
948  if( value.getIdentifier() == "UT_DOUBLE_VEC3") return vl::UT_DOUBLE_VEC3;
949  if( value.getIdentifier() == "UT_DOUBLE_VEC4") return vl::UT_DOUBLE_VEC4;
950 
951  if( value.getIdentifier() == "UT_DOUBLE_MAT2") return vl::UT_DOUBLE_MAT2;
952  if( value.getIdentifier() == "UT_DOUBLE_MAT3") return vl::UT_DOUBLE_MAT3;
953  if( value.getIdentifier() == "UT_DOUBLE_MAT4") return vl::UT_DOUBLE_MAT4;
954 
955  if( value.getIdentifier() == "UT_DOUBLE_MAT2x3") return vl::UT_DOUBLE_MAT2x3;
956  if( value.getIdentifier() == "UT_DOUBLE_MAT3x2") return vl::UT_DOUBLE_MAT3x2;
957  if( value.getIdentifier() == "UT_DOUBLE_MAT2x4") return vl::UT_DOUBLE_MAT2x4;
958  if( value.getIdentifier() == "UT_DOUBLE_MAT4x2") return vl::UT_DOUBLE_MAT4x2;
959  if( value.getIdentifier() == "UT_DOUBLE_MAT3x4") return vl::UT_DOUBLE_MAT3x4;
960  if( value.getIdentifier() == "UT_DOUBLE_MAT4x3") return vl::UT_DOUBLE_MAT4x3;
961 
962  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
964  return vl::UT_NONE;
965  }
966 
968  {
969  switch(dtm)
970  {
971  default:
972  case vl::DTM_RED: return "DTM_RED";
973  case vl::DTM_LUMINANCE: return "DTM_LUMINANCE";
974  case vl::DTM_INTENSITY: return "DTM_INTENSITY";
975  case vl::DTM_ALPHA: return "DTM_ALPHA";
976  }
977  }
978 
980  {
981  if( value.getIdentifier() == "DTM_LUMINANCE") return vl::DTM_LUMINANCE;
982  if( value.getIdentifier() == "DTM_INTENSITY") return vl::DTM_INTENSITY;
983  if( value.getIdentifier() == "DTM_ALPHA") return vl::DTM_ALPHA;
984  if( value.getIdentifier() == "DTM_RED") return vl::DTM_RED;
985 
986  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
988  return vl::DTM_RED;
989  }
990 
991  inline const char* vlx_ETexCompareMode(vl::ETexCompareMode tcm)
992  {
993  switch(tcm)
994  {
995  default:
996  case vl::TCM_NONE: return "TCM_NONE";
997  // case vl::TCM_COMPARE_R_TO_TEXTURE: return "TCM_COMPARE_R_TO_TEXTURE";
998  case vl::TCM_COMPARE_REF_DEPTH_TO_TEXTURE: return "TCM_COMPARE_REF_DEPTH_TO_TEXTURE";
999  }
1000  }
1001 
1003  {
1004  if( value.getIdentifier() == "TCM_COMPARE_R_TO_TEXTURE") return vl::TCM_COMPARE_R_TO_TEXTURE;
1005  if( value.getIdentifier() == "TCM_COMPARE_REF_DEPTH_TO_TEXTURE") return vl::TCM_COMPARE_REF_DEPTH_TO_TEXTURE;
1006  if( value.getIdentifier() == "TCM_NONE") return vl::TCM_NONE;
1007 
1008  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1010  return vl::TCM_NONE;
1011  }
1012 
1014  {
1015  switch(tcf)
1016  {
1017  default:
1018  case vl::TCF_LEQUAL: return "TCF_LEQUAL";
1019  case vl::TCF_GEQUAL: return "TCF_GEQUAL";
1020  case vl::TCF_LESS: return "TCF_LESS";
1021  case vl::TCF_GREATER: return "TCF_GREATER";
1022  case vl::TCF_EQUAL: return "TCF_EQUAL";
1023  case vl::TCF_NOTEQUAL: return "TCF_NOTEQUAL";
1024  case vl::TCF_ALWAYS: return "TCF_ALWAYS";
1025  case vl::TCF_NEVER: return "TCF_NEVER";
1026  }
1027  }
1028 
1030  {
1031  if( value.getIdentifier() == "TCF_GEQUAL") return vl::TCF_GEQUAL;
1032  if( value.getIdentifier() == "TCF_LESS") return vl::TCF_LESS;
1033  if( value.getIdentifier() == "TCF_GREATER") return vl::TCF_GREATER;
1034  if( value.getIdentifier() == "TCF_EQUAL") return vl::TCF_EQUAL;
1035  if( value.getIdentifier() == "TCF_NOTEQUAL") return vl::TCF_NOTEQUAL;
1036  if( value.getIdentifier() == "TCF_ALWAYS") return vl::TCF_ALWAYS;
1037  if( value.getIdentifier() == "TCF_NEVER") return vl::TCF_NEVER;
1038  if( value.getIdentifier() == "TCF_LEQUAL") return vl::TCF_LEQUAL;
1039 
1040  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1042  return vl::TCF_LEQUAL;
1043  }
1044 
1046  {
1047  switch(tpf)
1048  {
1049  default:
1050  case vl::TPF_NEAREST: return "TPF_NEAREST";
1051  case vl::TPF_LINEAR: return "TPF_LINEAR";
1052  case vl::TPF_NEAREST_MIPMAP_NEAREST: return "TPF_NEAREST_MIPMAP_NEAREST";
1053  case vl::TPF_LINEAR_MIPMAP_NEAREST: return "TPF_LINEAR_MIPMAP_NEAREST";
1054  case vl::TPF_NEAREST_MIPMAP_LINEAR: return "TPF_NEAREST_MIPMAP_LINEAR";
1055  case vl::TPF_LINEAR_MIPMAP_LINEAR: return "TPF_LINEAR_MIPMAP_LINEAR";
1056  }
1057  }
1058 
1060  {
1061  if( value.getIdentifier() == "TPF_LINEAR") return vl::TPF_LINEAR;
1062  if( value.getIdentifier() == "TPF_NEAREST_MIPMAP_NEAREST") return vl::TPF_NEAREST_MIPMAP_NEAREST;
1063  if( value.getIdentifier() == "TPF_LINEAR_MIPMAP_NEAREST") return vl::TPF_LINEAR_MIPMAP_NEAREST;
1064  if( value.getIdentifier() == "TPF_NEAREST_MIPMAP_LINEAR") return vl::TPF_NEAREST_MIPMAP_LINEAR;
1065  if( value.getIdentifier() == "TPF_LINEAR_MIPMAP_LINEAR") return vl::TPF_LINEAR_MIPMAP_LINEAR;
1066  if( value.getIdentifier() == "TPF_NEAREST") return vl::TPF_NEAREST;
1067 
1068  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1070  return vl::TPF_NEAREST;
1071  }
1072 
1073  inline const char* vlx_ETexParamWrap(vl::ETexParamWrap tpw)
1074  {
1075  switch(tpw)
1076  {
1077  default:
1078  case vl::TPW_REPEAT: return "TPW_REPEAT";
1079  case vl::TPW_CLAMP: return "TPW_CLAMP";
1080  case vl::TPW_CLAMP_TO_BORDER: return "TPW_CLAMP_TO_BORDER";
1081  case vl::TPW_CLAMP_TO_EDGE: return "TPW_CLAMP_TO_EDGE";
1082  case vl::TPW_MIRRORED_REPEAT: return "TPW_MIRRORED_REPEAT";
1083  }
1084  }
1085 
1087  {
1088  if( value.getIdentifier() == "TPW_CLAMP") return vl::TPW_CLAMP;
1089  if( value.getIdentifier() == "TPW_CLAMP_TO_BORDER") return vl::TPW_CLAMP_TO_BORDER;
1090  if( value.getIdentifier() == "TPW_CLAMP_TO_EDGE") return vl::TPW_CLAMP_TO_EDGE;
1091  if( value.getIdentifier() == "TPW_MIRRORED_REPEAT") return vl::TPW_MIRRORED_REPEAT;
1092  if( value.getIdentifier() == "TPW_REPEAT") return vl::TPW_REPEAT;
1093 
1094  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1096  return vl::TPW_REPEAT;
1097  }
1098 
1099  inline const char* vlx_EEnable(vl::EEnable en)
1100  {
1101  switch(en)
1102  {
1103  default:
1104  return "EN_UnknownEnable";
1105  case vl::EN_BLEND: return "EN_BLEND";
1106  case vl::EN_CULL_FACE: return "EN_CULL_FACE";
1107  case vl::EN_DEPTH_TEST: return "EN_DEPTH_TEST";
1108  case vl::EN_STENCIL_TEST: return "EN_STENCIL_TEST";
1109  case vl::EN_DITHER: return "EN_DITHER";
1110  case vl::EN_POLYGON_OFFSET_FILL: return "EN_POLYGON_OFFSET_FILL";
1111  case vl::EN_POLYGON_OFFSET_LINE: return "EN_POLYGON_OFFSET_LINE";
1112  case vl::EN_POLYGON_OFFSET_POINT: return "EN_POLYGON_OFFSET_POINT";
1113  case vl::EN_COLOR_LOGIC_OP: return "EN_COLOR_LOGIC_OP";
1114  case vl::EN_MULTISAMPLE: return "EN_MULTISAMPLE";
1115  case vl::EN_POINT_SMOOTH: return "EN_POINT_SMOOTH";
1116  case vl::EN_LINE_SMOOTH: return "EN_LINE_SMOOTH";
1117  case vl::EN_POLYGON_SMOOTH: return "EN_POLYGON_SMOOTH";
1118  case vl::EN_LINE_STIPPLE: return "EN_LINE_STIPPLE";
1119  case vl::EN_POLYGON_STIPPLE: return "EN_POLYGON_STIPPLE";
1120  case vl::EN_POINT_SPRITE: return "EN_POINT_SPRITE";
1121  case vl::EN_PROGRAM_POINT_SIZE: return "EN_PROGRAM_POINT_SIZE";
1122  case vl::EN_ALPHA_TEST: return "EN_ALPHA_TEST";
1123  case vl::EN_LIGHTING: return "EN_LIGHTING";
1124  case vl::EN_COLOR_SUM: return "EN_COLOR_SUM";
1125  case vl::EN_FOG: return "EN_FOG";
1126  case vl::EN_NORMALIZE: return "EN_NORMALIZE";
1127  case vl::EN_RESCALE_NORMAL: return "EN_RESCALE_NORMAL";
1128  case vl::EN_VERTEX_PROGRAM_TWO_SIDE: return "EN_VERTEX_PROGRAM_TWO_SIDE";
1129  case vl::EN_TEXTURE_CUBE_MAP_SEAMLESS: return "EN_TEXTURE_CUBE_MAP_SEAMLESS";
1130  case vl::EN_CLIP_DISTANCE0: return "EN_CLIP_DISTANCE0";
1131  case vl::EN_CLIP_DISTANCE1: return "EN_CLIP_DISTANCE1";
1132  case vl::EN_CLIP_DISTANCE2: return "EN_CLIP_DISTANCE2";
1133  case vl::EN_CLIP_DISTANCE3: return "EN_CLIP_DISTANCE3";
1134  case vl::EN_CLIP_DISTANCE4: return "EN_CLIP_DISTANCE4";
1135  case vl::EN_CLIP_DISTANCE5: return "EN_CLIP_DISTANCE5";
1136  case vl::EN_CLIP_DISTANCE6: return "EN_CLIP_DISTANCE6";
1137  case vl::EN_CLIP_DISTANCE7: return "EN_CLIP_DISTANCE7";
1138  case vl::EN_SAMPLE_ALPHA_TO_COVERAGE: return "EN_SAMPLE_ALPHA_TO_COVERAGE";
1139  case vl::EN_SAMPLE_ALPHA_TO_ONE: return "EN_SAMPLE_ALPHA_TO_ONE";
1140  case vl::EN_SAMPLE_COVERAGE: return "EN_SAMPLE_COVERAGE";
1141  }
1142  }
1143 
1145  {
1146  if( value.getIdentifier() == "EN_BLEND") return vl::EN_BLEND;
1147  if( value.getIdentifier() == "EN_CULL_FACE") return vl::EN_CULL_FACE;
1148  if( value.getIdentifier() == "EN_DEPTH_TEST") return vl::EN_DEPTH_TEST;
1149  if( value.getIdentifier() == "EN_STENCIL_TEST") return vl::EN_STENCIL_TEST;
1150  if( value.getIdentifier() == "EN_DITHER") return vl::EN_DITHER;
1151  if( value.getIdentifier() == "EN_POLYGON_OFFSET_FILL") return vl::EN_POLYGON_OFFSET_FILL;
1152  if( value.getIdentifier() == "EN_POLYGON_OFFSET_LINE") return vl::EN_POLYGON_OFFSET_LINE;
1153  if( value.getIdentifier() == "EN_POLYGON_OFFSET_POINT") return vl::EN_POLYGON_OFFSET_POINT;
1154  if( value.getIdentifier() == "EN_COLOR_LOGIC_OP") return vl::EN_COLOR_LOGIC_OP;
1155  if( value.getIdentifier() == "EN_MULTISAMPLE") return vl::EN_MULTISAMPLE;
1156  if( value.getIdentifier() == "EN_POINT_SMOOTH") return vl::EN_POINT_SMOOTH;
1157  if( value.getIdentifier() == "EN_LINE_SMOOTH") return vl::EN_LINE_SMOOTH;
1158  if( value.getIdentifier() == "EN_POLYGON_SMOOTH") return vl::EN_POLYGON_SMOOTH;
1159  if( value.getIdentifier() == "EN_LINE_STIPPLE") return vl::EN_LINE_STIPPLE;
1160  if( value.getIdentifier() == "EN_POLYGON_STIPPLE") return vl::EN_POLYGON_STIPPLE;
1161  if( value.getIdentifier() == "EN_POINT_SPRITE") return vl::EN_POINT_SPRITE;
1162  if( value.getIdentifier() == "EN_PROGRAM_POINT_SIZE") return vl::EN_PROGRAM_POINT_SIZE;
1163  if( value.getIdentifier() == "EN_ALPHA_TEST") return vl::EN_ALPHA_TEST;
1164  if( value.getIdentifier() == "EN_LIGHTING") return vl::EN_LIGHTING;
1165  if( value.getIdentifier() == "EN_COLOR_SUM") return vl::EN_COLOR_SUM;
1166  if( value.getIdentifier() == "EN_FOG") return vl::EN_FOG;
1167  if( value.getIdentifier() == "EN_NORMALIZE") return vl::EN_NORMALIZE;
1168  if( value.getIdentifier() == "EN_RESCALE_NORMAL") return vl::EN_RESCALE_NORMAL;
1169  if( value.getIdentifier() == "EN_VERTEX_PROGRAM_TWO_SIDE") return vl::EN_VERTEX_PROGRAM_TWO_SIDE;
1170  if( value.getIdentifier() == "EN_TEXTURE_CUBE_MAP_SEAMLESS") return vl::EN_TEXTURE_CUBE_MAP_SEAMLESS;
1171  if( value.getIdentifier() == "EN_CLIP_DISTANCE0") return vl::EN_CLIP_DISTANCE0;
1172  if( value.getIdentifier() == "EN_CLIP_DISTANCE1") return vl::EN_CLIP_DISTANCE1;
1173  if( value.getIdentifier() == "EN_CLIP_DISTANCE2") return vl::EN_CLIP_DISTANCE2;
1174  if( value.getIdentifier() == "EN_CLIP_DISTANCE3") return vl::EN_CLIP_DISTANCE3;
1175  if( value.getIdentifier() == "EN_CLIP_DISTANCE4") return vl::EN_CLIP_DISTANCE4;
1176  if( value.getIdentifier() == "EN_CLIP_DISTANCE5") return vl::EN_CLIP_DISTANCE5;
1177  if( value.getIdentifier() == "EN_CLIP_DISTANCE6") return vl::EN_CLIP_DISTANCE6;
1178  if( value.getIdentifier() == "EN_CLIP_DISTANCE7") return vl::EN_CLIP_DISTANCE7;
1179  if( value.getIdentifier() == "EN_SAMPLE_ALPHA_TO_COVERAGE") return vl::EN_SAMPLE_ALPHA_TO_COVERAGE;
1180  if( value.getIdentifier() == "EN_SAMPLE_ALPHA_TO_ONE") return vl::EN_SAMPLE_ALPHA_TO_ONE;
1181  if( value.getIdentifier() == "EN_SAMPLE_COVERAGE") return vl::EN_SAMPLE_COVERAGE;
1182 
1183  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1185  return vl::EN_UnknownEnable;
1186  }
1187 
1189  {
1190  if( value.getIdentifier() == "PT_POINTS") return vl::PT_POINTS;
1191  if( value.getIdentifier() == "PT_LINES") return vl::PT_LINES;
1192  if( value.getIdentifier() == "PT_LINE_LOOP") return vl::PT_LINE_LOOP;
1193  if( value.getIdentifier() == "PT_LINE_STRIP") return vl::PT_LINE_STRIP;
1194  if( value.getIdentifier() == "PT_TRIANGLES") return vl::PT_TRIANGLES;
1195  if( value.getIdentifier() == "PT_TRIANGLE_STRIP") return vl::PT_TRIANGLE_STRIP;
1196  if( value.getIdentifier() == "PT_TRIANGLE_FAN") return vl::PT_TRIANGLE_FAN;
1197  if( value.getIdentifier() == "PT_QUADS") return vl::PT_QUADS;
1198  if( value.getIdentifier() == "PT_QUAD_STRIP") return vl::PT_QUAD_STRIP;
1199  if( value.getIdentifier() == "PT_POLYGON") return vl::PT_POLYGON;
1200  if( value.getIdentifier() == "PT_LINES_ADJACENCY") return vl::PT_LINES_ADJACENCY;
1201  if( value.getIdentifier() == "PT_LINE_STRIP_ADJACENCY") return vl::PT_LINE_STRIP_ADJACENCY;
1202  if( value.getIdentifier() == "PT_TRIANGLES_ADJACENCY") return vl::PT_TRIANGLES_ADJACENCY;
1203  if( value.getIdentifier() == "PT_TRIANGLE_STRIP_ADJACENCY") return vl::PT_TRIANGLES_ADJACENCY;
1204  if( value.getIdentifier() == "PT_PATCHES") return vl::PT_PATCHES;
1205  if( value.getIdentifier() == "PT_UNKNOWN") return vl::PT_UNKNOWN;
1206 
1207  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1209  return vl::PT_UNKNOWN;
1210  }
1211 
1212  inline const char* vlx_EPrimitiveType(vl::EPrimitiveType type)
1213  {
1214  switch(type)
1215  {
1216  case vl::PT_POINTS: return "PT_POINTS"; break;
1217  case vl::PT_LINES: return "PT_LINES"; break;
1218  case vl::PT_LINE_LOOP: return "PT_LINE_LOOP"; break;
1219  case vl::PT_LINE_STRIP: return "PT_LINE_STRIP"; break;
1220  case vl::PT_TRIANGLES: return "PT_TRIANGLES"; break;
1221  case vl::PT_TRIANGLE_STRIP: return "PT_TRIANGLE_STRIP"; break;
1222  case vl::PT_TRIANGLE_FAN: return "PT_TRIANGLE_FAN"; break;
1223  case vl::PT_QUADS: return "PT_QUADS"; break;
1224  case vl::PT_QUAD_STRIP: return "PT_QUAD_STRIP"; break;
1225  case vl::PT_POLYGON: return "PT_POLYGON"; break;
1226  case vl::PT_LINES_ADJACENCY: return "PT_LINES_ADJACENCY"; break;
1227  case vl::PT_LINE_STRIP_ADJACENCY: return "PT_LINE_STRIP_ADJACENCY"; break;
1228  case vl::PT_TRIANGLES_ADJACENCY: return "PT_TRIANGLES_ADJACENCY"; break;
1229  case vl::PT_TRIANGLE_STRIP_ADJACENCY: return "PT_TRIANGLE_STRIP_ADJACENCY"; break;
1230  case vl::PT_PATCHES: return "PT_PATCHES"; break;
1231  default:
1232  case vl::PT_UNKNOWN: return "PT_UNKNOWN"; break;
1233  }
1234  }
1235 
1237  {
1238  if( value.getIdentifier() == "VAI_NORMAL") return vl::VAI_NORMAL;
1239  if( value.getIdentifier() == "VAI_INTEGER") return vl::VAI_INTEGER;
1240  if( value.getIdentifier() == "VAI_DOUBLE") return vl::VAI_DOUBLE;
1241 
1242  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1244  return vl::VAI_NORMAL;
1245  }
1246 
1248  {
1249  switch(type)
1250  {
1251  default:
1252  case vl::VAI_NORMAL: return "VAI_NORMAL"; break;
1253  case vl::VAI_INTEGER: return "VAI_INTEGER"; break;
1254  case vl::VAI_DOUBLE: return "VAI_DOUBLE"; break;
1255  }
1256  }
1257 
1259  {
1260  if( value.getIdentifier() == "TD_TEXTURE_1D") return vl::TD_TEXTURE_1D;
1261  if( value.getIdentifier() == "TD_TEXTURE_2D") return vl::TD_TEXTURE_2D;
1262  if( value.getIdentifier() == "TD_TEXTURE_3D") return vl::TD_TEXTURE_3D;
1263  if( value.getIdentifier() == "TD_TEXTURE_CUBE_MAP") return vl::TD_TEXTURE_CUBE_MAP;
1264  if( value.getIdentifier() == "TD_TEXTURE_RECTANGLE") return vl::TD_TEXTURE_RECTANGLE;
1265  if( value.getIdentifier() == "TD_TEXTURE_1D_ARRAY") return vl::TD_TEXTURE_1D_ARRAY;
1266  if( value.getIdentifier() == "TD_TEXTURE_2D_ARRAY") return vl::TD_TEXTURE_2D_ARRAY;
1267  if( value.getIdentifier() == "TD_TEXTURE_BUFFER") return vl::TD_TEXTURE_BUFFER;
1268  if( value.getIdentifier() == "TD_TEXTURE_2D_MULTISAMPLE") return vl::TD_TEXTURE_2D_MULTISAMPLE;
1269  if( value.getIdentifier() == "TD_TEXTURE_2D_MULTISAMPLE_ARRAY") return vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY;
1270  if( value.getIdentifier() == "TD_TEXTURE_UNKNOWN") return vl::TD_TEXTURE_UNKNOWN;
1271 
1272  vl::Log::error( vl::Say("Line %n : unknown token '%s'.\n") << value.lineNumber() << value.getIdentifier() );
1274  return vl::TD_TEXTURE_UNKNOWN;
1275  }
1276 
1278  {
1279  switch(td)
1280  {
1281  case vl::TD_TEXTURE_1D: return "TD_TEXTURE_1D";
1282  case vl::TD_TEXTURE_2D: return "TD_TEXTURE_2D";
1283  case vl::TD_TEXTURE_3D: return "TD_TEXTURE_3D";
1284  case vl::TD_TEXTURE_CUBE_MAP: return "TD_TEXTURE_CUBE_MAP";
1285  case vl::TD_TEXTURE_RECTANGLE: return "TD_TEXTURE_RECTANGLE";
1286  case vl::TD_TEXTURE_1D_ARRAY: return "TD_TEXTURE_1D_ARRAY";
1287  case vl::TD_TEXTURE_2D_ARRAY: return "TD_TEXTURE_2D_ARRAY";
1288  case vl::TD_TEXTURE_BUFFER: return "TD_TEXTURE_BUFFER";
1289  case vl::TD_TEXTURE_2D_MULTISAMPLE: return "TD_TEXTURE_2D_MULTISAMPLE";
1290  case vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY: return "TD_TEXTURE_2D_MULTISAMPLE_ARRAY";
1291  case vl::TD_TEXTURE_UNKNOWN: return "TD_TEXTURE_UNKNOWN";
1292  default:
1293  vl::Log::error( vl::Say("Invalid texture dimension %n\n") << td );
1294  VL_TRAP()
1295  return "TD_TEXTURE_UNKNOWN";
1296  }
1297  }
1298 
1299 }
1300 
1301 #endif
vl::EPrimitiveType vlx_EPrimitiveType(const VLXValue &value, VLXSerializer &s)
Definition: vlxutils.hpp:1188
const T_Scalar & z() const
Definition: Vector4.hpp:103
If enabled, clip geometry against user-defined half space #7.
const T_Scalar & e(int i, int j) const
Definition: Matrix4.hpp:660
If enabled, clip geometry against user-defined half space #1.
const T_Scalar & x() const
Definition: Vector4.hpp:101
Wrapper for all VLX value types.
Definition: Value.hpp:240
Projection matrix generated by mat4::getPerspective() or similar.
If enabled, do depth comparisons and update the depth buffer; Note that even if the depth buffer exis...
EPolygonFace
Matrix4 & setT(const Vector3< T_Scalar > &v)
Definition: Matrix4.hpp:160
vl::vec4 vlx_vec4(const VLXArrayReal *arr)
Definition: vlxutils.hpp:58
const char * vlx_ETextureFormat(vl::ETextureFormat tf)
Definition: vlxutils.hpp:383
A simple String formatting class.
Definition: Say.hpp:124
std::string vlx_makeTag(const vl::Object *obj)
Definition: vlxutils.hpp:44
ETexParamFilter
const T_Scalar & z() const
Definition: Vector3.hpp:91
VLXList * getList()
Definition: Value.hpp:410
If enabled, use the current polygon stipple pattern when rendering polygons, see also PolygonStipple...
If enabled, use the current lighting parameters to compute the vertex color; Otherwise, simply associate the current color with each vertex, see also Material, LightModel, and Light.
Data will be sent using glVertexAttribIPointer(), that is, values are always left as integer values...
[GL_VERTEX_PROGRAM_POINT_SIZE/GL_PROGRAM_POINT_SIZE] If enabled, and a vertex shader is active...
bool vlx_isTranslation(const vl::mat4 &mat)
Definition: vlxutils.hpp:131
If enabled, blend the incoming RGBA color values with the values in the color buffers, see also BlendFunc for more information.
VLXValue vlx_String(const std::string &str)
Definition: vlxutils.hpp:50
const char * vlx_EPolygonFace(vl::EPolygonFace pf)
Definition: vlxutils.hpp:335
void copyTo(T2 *ptr) const
Definition: Value.hpp:124
If enabled, dither color components or indices before they are written to the color buffer...
If enabled, add the secondary color value to the computed fragment color.
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
Definition: Log.cpp:165
const char * vlx_EClearColorMode(vl::EClearColorMode ccm)
Definition: vlxutils.hpp:281
void copyFrom(const T2 *ptr)
Definition: Value.hpp:126
An array of 64 bits floating point numbers, can also have a tag.
Definition: Value.hpp:144
The Vector4 class is a template class that implements a generic 4 components vector, see also vl::fvec4, vl::dvec4, vl::uvec4, vl::ivec4, vl::svec4, vl::usvec4, vl::bvec4, vl::ubvec4.
Definition: Vector4.hpp:44
vl::vec3 vlx_vec3(const VLXArrayReal *arr)
Definition: vlxutils.hpp:56
const char * vlx_ETexCompareMode(vl::ETexCompareMode tcm)
Definition: vlxutils.hpp:991
const char * vlx_EProjectionMatrixType(vl::EProjectionMatrixType pt)
Definition: vlxutils.hpp:257
If enabled, draw points with proper filtering; Otherwise, draw aliased points, see also PointSize...
If enabled, an offset is added to depth values of a polygon&#39;s fragments before the depth comparison i...
If enabled, performs alpha testing, see also AlphaFunc for more information.
EUniformType
Uniform types, see also vl::UniformInfo, vl::GLSLProgram, vl::Uniform, http://www.opengl.org/sdk/docs/man4/xhtml/glGetActiveUniform.xml.
If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to depth values of a p...
EPrimitiveType
If enabled, clip geometry against user-defined half space #5.
std::vector< VLXValue > & value()
Definition: Value.hpp:652
Projection matrix generated by mat4::getFrustum() or similar.
const char * vlx_EClearFlags(vl::EClearFlags cf)
Definition: vlxutils.hpp:303
const char * vlx_EEnable(vl::EEnable en)
Definition: vlxutils.hpp:1099
const char * vlx_ETexParamFilter(vl::ETexParamFilter tpf)
Definition: vlxutils.hpp:1045
int lineNumber() const
Definition: Value.hpp:55
EProjectionMatrixType
void setError(EError err)
Sets a serialization error.
Definition: Serializer.hpp:138
#define VL_TRAP()
Definition: checks.hpp:70
const char * vlx_EDepthTextureMode(vl::EDepthTextureMode dtm)
Definition: vlxutils.hpp:967
EColorMaterial
const char * vlx_ETexCompareFunc(vl::ETexCompareFunc tcf)
Definition: vlxutils.hpp:1013
Data will be sent using glVertexAttribLPointer(), that is, it will be associated with a shader attrib...
Projection matrix generated by mat4::getOrtho() or similar.
A simple sequence of VLXValue objects, can also have a tag.
Definition: Value.hpp:634
The base class for all the reference counted objects.
Definition: Object.hpp:158
If enabled, each sample alpha value is replaced by the maximum representable alpha value...
vl::uvec4 vlx_uivec4(const VLXArrayInteger *arr)
Definition: vlxutils.hpp:62
const std::string & tag() const
Definition: Value.hpp:63
vl::ivec4 vlx_ivec4(const VLXArrayInteger *arr)
Definition: vlxutils.hpp:60
ETexCompareMode
If enabled, clip geometry against user-defined half space #2.
If enabled, draw lines with correct filtering; Otherwise, draw aliased lines, see also LineWidth...
const T_Scalar & y() const
Definition: Vector3.hpp:90
static Matrix4 getNull()
Definition: Matrix4.hpp:401
VLXValue vlx_Identifier(const std::string &str)
Definition: vlxutils.hpp:46
const T_Scalar & y() const
Definition: Vector4.hpp:102
If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the...
If enabled, calculate texture coordinates for points based on texture environment and point parameter...
EClearColorMode
bool isIdentity() const
Definition: Matrix4.hpp:304
The Matrix4 class is a template class that implements a generic 4x4 matrix, see also vl::dmat4...
Definition: Matrix4.hpp:48
#define NULL
Definition: OpenGLDefs.hpp:81
If enabled, apply the currently selected logical operation to the incoming RGBA color and color buffe...
VLX_EXPORT VLXArray * setArray(VLXArray *)
Definition: Value.cpp:225
Data will be sent using glVertexAttribPointer(), that is, data will be converted to floating point pr...
EClearFlags
If enabled, clip geometry against user-defined half space #0.
An array of 64 bits integers, can also have a tag.
Definition: Value.hpp:133
A block of raw text.
Definition: Value.hpp:71
VLXValue vlx_ID(const std::string &str)
Definition: vlxutils.hpp:48
ETextureDimension
If enabled, blend a fog color into the post-texturing color, see also Fog.
Vector3< T_Scalar > getT() const
Definition: Matrix4.hpp:131
std::vector< T > & value()
Definition: Value.hpp:116
EEnable
Constant that enable/disable a specific OpenGL feature, see also Shader, Shader::enable(), Shader::disable(), Shader::isEnabled()
vl::vec2 vlx_vec2(const VLXArrayReal *arr)
Definition: vlxutils.hpp:54
VLXValue vlx_Rawtext(const std::string &str)
Definition: vlxutils.hpp:52
Unknown or other projection type.
ETexParamWrap
Translates an arbitrary set of vl::Object (and subclasses) into VLB and VLT format.
Definition: Serializer.hpp:45
If enabled, use multiple fragment samples in computing the final color of a pixel.
static Matrix4 & getTranslation(Matrix4 &out, const Vector3< float > &v)
Definition: Matrix4.hpp:548
T_Scalar * ptr()
Definition: Matrix4.hpp:340
If enabled, and a vertex shader is active, it specifies that the GL will choose between front and bac...
If enabled, do stencil testing and update the stencil buffer, see also StencilFunc and StencilOp...
vl::EVertexAttribInterpretation vlx_EVertexAttribInterpretation(const VLXValue &value, VLXSerializer &s)
Definition: vlxutils.hpp:1236
static Matrix4 & getScaling(Matrix4 &out, const Vector3< float > &v)
Definition: Matrix4.hpp:584
ETexCompareFunc
int lineNumber() const
Definition: Value.hpp:519
const T_Scalar & x() const
Definition: Vector3.hpp:89
If enabled, clip geometry against user-defined half space #6.
const char * vlx_EColorMaterial(vl::EColorMaterial cm)
Definition: vlxutils.hpp:357
vl::mat4 vlx_mat4(const VLXArrayReal *arr)
Definition: vlxutils.hpp:182
const T_Scalar & x() const
Definition: Vector2.hpp:132
vl::ETextureDimension vlx_ETextureDimension(const VLXValue &value, VLXSerializer &s)
Definition: vlxutils.hpp:1258
const char * vlx_EUniformType(vl::EUniformType type)
Definition: vlxutils.hpp:867
VLXArrayInteger * getArrayInteger()
Definition: Value.hpp:444
EType type() const
Definition: Value.hpp:396
If enabled, cubemap textures are sampled such that when linearly sampling from the border between two...
If enabled, the fragment&#39;s coverage is ANDed with the temporary coverage value; If GL_SAMPLE_COVERAGE...
ETextureFormat
Definition: vlnamespace.hpp:45
For internal use only.
If enabled, draw polygons with proper filtering; Otherwise, draw aliased polygons; For correct antial...
If enabled, normals are scaled by a scaling factor derived from the modelview matrix; vl::EN_RESCALE_...
const T_Scalar & y() const
Definition: Vector2.hpp:133
EDepthTextureMode
VLXValue vlx_toValue(const std::vector< int > &vec)
Definition: vlxutils.hpp:64
static Matrix4 getLookAt(const Vector3< float > &eye, const Vector3< float > &at, const Vector3< float > &up)
Definition: Matrix4.hpp:783
If enabled, normal vectors are scaled to unit length after transformation, see also vl::EN_RESCALE_NO...
If enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to depth values of a p...
#define VL_CHECK(expr)
Definition: checks.hpp:73
EVertexAttribInterpretation
Specifies how the data of a VertexAttribInfo is sent to the OpenGL driver, see also http://www...
VLXArrayReal * getArrayReal()
Definition: Value.hpp:447
const char * vlx_ETexParamWrap(vl::ETexParamWrap tpw)
Definition: vlxutils.hpp:1073
bool vlx_isScaling(const vl::mat4 &mat)
Definition: vlxutils.hpp:138
If enabled, clip geometry against user-defined half space #3.
const std::string & getIdentifier() const
Definition: Value.hpp:472
If enabled, use the current line stipple pattern when drawing lines, see also LineStipple.
const T_Scalar & w() const
Definition: Vector4.hpp:104
If enabled, cull polygons based on their winding in window coordinates, see also CullFace.
If enabled, clip geometry against user-defined half space #4.