0.8.0 API documentation
type.hpp
Go to the documentation of this file.
1 
4 #pragma once
5 
6 // STD
7 #include <cstddef>
8 
9 // GLM
10 #define GLM_FORCE_EXPLICIT_CTOR
11 #include <glm/glm.hpp>
12 #include <glm/gtc/vec1.hpp>
13 #include <glm/gtx/std_based_type.hpp>
14 
15 #if GLM_COMPILER & GLM_COMPILER_VC
16 # define GLI_FORCE_INLINE __forceinline
17 #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)
18 # define GLI_FORCE_INLINE inline __attribute__((__always_inline__))
19 #else
20 # define GLI_FORCE_INLINE inline
21 #endif//GLM_COMPILER
22 
23 #define GLI_DISABLE_ASSERT 0
24 
25 #if defined(NDEBUG) || GLI_DISABLE_ASSERT
26 # define GLI_ASSERT(test)
27 #else
28 # define GLI_ASSERT(test) assert((test))
29 #endif
30 
31 namespace gli
32 {
33  using namespace glm;
34 
35  using std::size_t;
36 
37  typedef tvec1<int> extent1d;
38  typedef tvec2<int> extent2d;
39  typedef tvec3<int> extent3d;
40  typedef tvec4<int> extent4d;
41 
42  template <typename T, precision P>
43  inline tvec4<T, P> make_vec4(tvec1<T, P> const & v)
44  {
45  return tvec4<T, P>(v.x, static_cast<T>(0), static_cast<T>(0), static_cast<T>(1));
46  }
47 
48  template <typename T, precision P>
49  inline tvec4<T, P> make_vec4(tvec2<T, P> const & v)
50  {
51  return tvec4<T, P>(v.x, v.y, static_cast<T>(0), static_cast<T>(1));
52  }
53 
54  template <typename T, precision P>
55  inline tvec4<T, P> make_vec4(tvec3<T, P> const & v)
56  {
57  return tvec4<T, P>(v.x, v.y, v.z, static_cast<T>(1));
58  }
59 
60  template <typename T, precision P>
61  inline tvec4<T, P> make_vec4(tvec4<T, P> const & v)
62  {
63  return v;
64  }
65 }//namespace gli
Namespace where all the classes and functions provided by GLI are exposed.
Definition: comparison.hpp:15