GLM  0.9.5
type_vec.hpp
1 
29 #ifndef glm_core_type_vec
30 #define glm_core_type_vec
31 
32 #include "precision.hpp"
33 #include "type_int.hpp"
34 
35 namespace glm{
36 namespace detail
37 {
38  template <typename T, precision P> struct tvec1;
39  template <typename T, precision P> struct tvec2;
40  template <typename T, precision P> struct tvec3;
41  template <typename T, precision P> struct tvec4;
42 
43  template <typename T>
44  struct is_vector
45  {
46  enum is_vector_enum
47  {
48  _YES = 0,
49  _NO = 1
50  };
51  };
52 
53 # define GLM_DETAIL_IS_VECTOR(TYPE) \
54  template <typename T, precision P> \
55  struct is_vector<TYPE<T, P> > \
56  { \
57  enum is_vector_enum \
58  { \
59  _YES = 1, \
60  _NO = 0 \
61  }; \
62  }
63 }//namespace detail
64 
65  typedef detail::tvec1<float, highp> highp_vec1_t;
66  typedef detail::tvec1<float, mediump> mediump_vec1_t;
67  typedef detail::tvec1<float, lowp> lowp_vec1_t;
68  typedef detail::tvec1<int, highp> highp_ivec1_t;
69  typedef detail::tvec1<int, mediump> mediump_ivec1_t;
70  typedef detail::tvec1<int, lowp> lowp_ivec1_t;
71  typedef detail::tvec1<uint, highp> highp_uvec1_t;
72  typedef detail::tvec1<uint, mediump> mediump_uvec1_t;
73  typedef detail::tvec1<uint, lowp> lowp_uvec1_t;
74  typedef detail::tvec1<bool, highp> highp_bvec1_t;
75  typedef detail::tvec1<bool, mediump> mediump_bvec1_t;
76  typedef detail::tvec1<bool, lowp> lowp_bvec1_t;
77 
80 
86  typedef detail::tvec2<float, highp> highp_vec2;
87 
93  typedef detail::tvec2<float, mediump> mediump_vec2;
94 
100  typedef detail::tvec2<float, lowp> lowp_vec2;
101 
107  typedef detail::tvec2<double, highp> highp_dvec2;
108 
114  typedef detail::tvec2<double, mediump> mediump_dvec2;
115 
121  typedef detail::tvec2<double, lowp> lowp_dvec2;
122 
128  typedef detail::tvec2<int, highp> highp_ivec2;
129 
135  typedef detail::tvec2<int, mediump> mediump_ivec2;
136 
142  typedef detail::tvec2<int, lowp> lowp_ivec2;
143 
149  typedef detail::tvec2<uint, highp> highp_uvec2;
150 
156  typedef detail::tvec2<uint, mediump> mediump_uvec2;
157 
163  typedef detail::tvec2<uint, lowp> lowp_uvec2;
164 
170  typedef detail::tvec2<bool, highp> highp_bvec2;
171 
177  typedef detail::tvec2<bool, mediump> mediump_bvec2;
178 
184  typedef detail::tvec2<bool, lowp> lowp_bvec2;
185 
187 
188 
191 
197  typedef detail::tvec3<float, highp> highp_vec3;
198 
204  typedef detail::tvec3<float, mediump> mediump_vec3;
205 
211  typedef detail::tvec3<float, lowp> lowp_vec3;
212 
218  typedef detail::tvec3<double, highp> highp_dvec3;
219 
225  typedef detail::tvec3<double, mediump> mediump_dvec3;
226 
232  typedef detail::tvec3<double, lowp> lowp_dvec3;
233 
239  typedef detail::tvec3<int, highp> highp_ivec3;
240 
246  typedef detail::tvec3<int, mediump> mediump_ivec3;
247 
253  typedef detail::tvec3<int, lowp> lowp_ivec3;
254 
260  typedef detail::tvec3<uint, highp> highp_uvec3;
261 
267  typedef detail::tvec3<uint, mediump> mediump_uvec3;
268 
274  typedef detail::tvec3<uint, lowp> lowp_uvec3;
275 
280  typedef detail::tvec3<bool, highp> highp_bvec3;
281 
286  typedef detail::tvec3<bool, mediump> mediump_bvec3;
287 
292  typedef detail::tvec3<bool, lowp> lowp_bvec3;
293 
295 
298 
303  typedef detail::tvec4<float, highp> highp_vec4;
304 
309  typedef detail::tvec4<float, mediump> mediump_vec4;
310 
315  typedef detail::tvec4<float, lowp> lowp_vec4;
316 
321  typedef detail::tvec4<double, highp> highp_dvec4;
322 
327  typedef detail::tvec4<double, mediump> mediump_dvec4;
328 
333  typedef detail::tvec4<double, lowp> lowp_dvec4;
334 
339  typedef detail::tvec4<int, highp> highp_ivec4;
340 
345  typedef detail::tvec4<int, mediump> mediump_ivec4;
346 
351  typedef detail::tvec4<int, lowp> lowp_ivec4;
352 
357  typedef detail::tvec4<uint, highp> highp_uvec4;
358 
363  typedef detail::tvec4<uint, mediump> mediump_uvec4;
364 
369  typedef detail::tvec4<uint, lowp> lowp_uvec4;
370 
375  typedef detail::tvec4<bool, highp> highp_bvec4;
376 
381  typedef detail::tvec4<bool, mediump> mediump_bvec4;
382 
387  typedef detail::tvec4<bool, lowp> lowp_bvec4;
388 
390 
393 
395  // Default float definition
396 
397 #if(defined(GLM_PRECISION_LOWP_FLOAT))
398  typedef lowp_vec2 vec2;
399  typedef lowp_vec3 vec3;
400  typedef lowp_vec4 vec4;
401 #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
402  typedef mediump_vec2 vec2;
403  typedef mediump_vec3 vec3;
404  typedef mediump_vec4 vec4;
405 #else //defined(GLM_PRECISION_HIGHP_FLOAT)
406  typedef highp_vec2 vec2;
410 
414  typedef highp_vec3 vec3;
415 
419  typedef highp_vec4 vec4;
420 #endif//GLM_PRECISION
421 
423  // Default double definition
424 
425 #if(defined(GLM_PRECISION_LOWP_DOUBLE))
426  typedef lowp_dvec2 dvec2;
427  typedef lowp_dvec3 dvec3;
428  typedef lowp_dvec4 dvec4;
429 #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
430  typedef mediump_dvec2 dvec2;
431  typedef mediump_dvec3 dvec3;
432  typedef mediump_dvec4 dvec4;
433 #else //defined(GLM_PRECISION_HIGHP_DOUBLE)
434  typedef highp_dvec2 dvec2;
438 
443 
448 #endif//GLM_PRECISION
449 
451  // Signed integer definition
452 
453 #if(defined(GLM_PRECISION_LOWP_INT))
454  typedef lowp_ivec2 ivec2;
455  typedef lowp_ivec3 ivec3;
456  typedef lowp_ivec4 ivec4;
457 #elif(defined(GLM_PRECISION_MEDIUMP_INT))
458  typedef mediump_ivec2 ivec2;
459  typedef mediump_ivec3 ivec3;
460  typedef mediump_ivec4 ivec4;
461 #else //defined(GLM_PRECISION_HIGHP_INT)
462  typedef highp_ivec2 ivec2;
466 
471 
476 #endif//GLM_PRECISION
477 
479  // Unsigned integer definition
480 
481 #if(defined(GLM_PRECISION_LOWP_UINT))
482  typedef lowp_uvec2 uvec2;
483  typedef lowp_uvec3 uvec3;
484  typedef lowp_uvec4 uvec4;
485 #elif(defined(GLM_PRECISION_MEDIUMP_UINT))
486  typedef mediump_uvec2 uvec2;
487  typedef mediump_uvec3 uvec3;
488  typedef mediump_uvec4 uvec4;
489 #else //defined(GLM_PRECISION_HIGHP_UINT)
490  typedef highp_uvec2 uvec2;
494 
499 
504 #endif//GLM_PRECISION
505 
507  // Boolean definition
508 
509 #if(defined(GLM_PRECISION_LOWP_BOOL))
510  typedef lowp_bvec2 bvec2;
511  typedef lowp_bvec3 bvec3;
512  typedef lowp_bvec4 bvec4;
513 #elif(defined(GLM_PRECISION_MEDIUMP_BOOL))
514  typedef mediump_bvec2 bvec2;
515  typedef mediump_bvec3 bvec3;
516  typedef mediump_bvec4 bvec4;
517 #else //defined(GLM_PRECISION_HIGHP_BOOL)
518  typedef highp_bvec2 bvec2;
522 
527 
532 #endif//GLM_PRECISION
533 
535 }//namespace glm
536 
537 #endif//glm_core_type_vec
highp_ivec4 ivec4
4 components vector of signed integer numbers.
Definition: type_vec.hpp:475
detail::tvec4< bool, highp > highp_bvec4
4 components vector of high precision bool numbers.
Definition: type_vec.hpp:375
detail::tvec2< uint, highp > highp_uvec2
2 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:149
detail::tvec4< uint, highp > highp_uvec4
4 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:357
highp_bvec3 bvec3
3 components vector of boolean.
Definition: type_vec.hpp:526
detail::tvec3< int, mediump > mediump_ivec3
3 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:246
highp_bvec2 bvec2
2 components vector of boolean.
Definition: type_vec.hpp:521
highp_vec3 vec3
3 components vector of floating-point numbers.
Definition: type_vec.hpp:414
highp_dvec3 dvec3
3 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:442
detail::tvec2< int, mediump > mediump_ivec2
2 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:135
detail::tvec4< double, lowp > lowp_dvec4
4 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:333
highp_ivec2 ivec2
2 components vector of signed integer numbers.
Definition: type_vec.hpp:465
detail::tvec2< uint, lowp > lowp_uvec2
2 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:163
highp_vec4 vec4
4 components vector of floating-point numbers.
Definition: type_vec.hpp:419
detail::tvec4< float, mediump > mediump_vec4
4 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:309
detail::tvec2< bool, mediump > mediump_bvec2
2 components vector of medium precision bool numbers.
Definition: type_vec.hpp:177
detail::tvec4< bool, lowp > lowp_bvec4
4 components vector of low precision bool numbers.
Definition: type_vec.hpp:387
detail::tvec3< uint, lowp > lowp_uvec3
3 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:274
detail::tvec3< float, lowp > lowp_vec3
3 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:211
detail::tvec4< int, lowp > lowp_ivec4
4 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:351
detail::tvec2< bool, highp > highp_bvec2
2 components vector of high precision bool numbers.
Definition: type_vec.hpp:170
detail::tvec4< double, highp > highp_dvec4
4 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:321
detail::tvec4< uint, lowp > lowp_uvec4
4 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:369
detail::tvec3< float, highp > highp_vec3
3 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:197
highp_dvec2 dvec2
2 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:437
detail::tvec3< bool, mediump > mediump_bvec3
3 components vector of medium precision bool numbers.
Definition: type_vec.hpp:286
detail::tvec4< double, mediump > mediump_dvec4
4 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:327
detail::tvec2< double, highp > highp_dvec2
2 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:107
detail::tvec3< uint, highp > highp_uvec3
3 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:260
highp_ivec3 ivec3
3 components vector of signed integer numbers.
Definition: type_vec.hpp:470
detail::tvec3< uint, mediump > mediump_uvec3
3 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:267
detail::tvec4< bool, mediump > mediump_bvec4
4 components vector of medium precision bool numbers.
Definition: type_vec.hpp:381
detail::tvec3< bool, lowp > lowp_bvec3
3 components vector of low precision bool numbers.
Definition: type_vec.hpp:292
detail::tvec3< double, highp > highp_dvec3
3 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:218
highp_uvec3 uvec3
3 components vector of unsigned integer numbers.
Definition: type_vec.hpp:498
highp_dvec4 dvec4
4 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:447
detail::tvec2< uint, mediump > mediump_uvec2
2 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:156
detail::tvec2< int, lowp > lowp_ivec2
2 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:142
detail::tvec2< bool, lowp > lowp_bvec2
2 components vector of low precision bool numbers.
Definition: type_vec.hpp:184
detail::tvec4< int, mediump > mediump_ivec4
4 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:345
detail::tvec2< double, lowp > lowp_dvec2
2 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:121
detail::tvec2< float, highp > highp_vec2
2 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:86
detail::tvec3< double, mediump > mediump_dvec3
3 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:225
detail::tvec3< double, lowp > lowp_dvec3
3 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:232
detail::tvec2< float, lowp > lowp_vec2
2 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:100
detail::tvec2< double, mediump > mediump_dvec2
2 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:114
highp_uvec4 uvec4
4 components vector of unsigned integer numbers.
Definition: type_vec.hpp:503
detail::tvec3< int, lowp > lowp_ivec3
3 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:253
highp_uvec2 uvec2
2 components vector of unsigned integer numbers.
Definition: type_vec.hpp:493
highp_bvec4 bvec4
4 components vector of boolean.
Definition: type_vec.hpp:531
detail::tvec2< int, highp > highp_ivec2
2 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:128
detail::tvec4< float, lowp > lowp_vec4
4 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:315
detail::tvec2< float, mediump > mediump_vec2
2 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:93
highp_vec2 vec2
2 components vector of floating-point numbers.
Definition: type_vec.hpp:409
detail::tvec3< int, highp > highp_ivec3
3 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:239
detail::tvec3< bool, highp > highp_bvec3
3 components vector of high precision bool numbers.
Definition: type_vec.hpp:280
detail::tvec4< float, highp > highp_vec4
4 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:303
detail::tvec4< int, highp > highp_ivec4
4 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:339
detail::tvec4< uint, mediump > mediump_uvec4
4 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:363
detail::tvec3< float, mediump > mediump_vec3
3 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:204