36 #include <type_traits>
38 #if GLM_HAS_EXTENDED_INTEGER_TYPE
45 # if GLM_HAS_EXTENDED_INTEGER_TYPE
56 # if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
59 # elif GLM_COMPILER & GLM_COMPILER_VC
60 typedef signed __int64 sint64;
61 typedef unsigned __int64
uint64;
62 # elif GLM_COMPILER & GLM_COMPILER_GCC
63 __extension__
typedef signed long long sint64;
64 __extension__
typedef unsigned long long uint64;
65 # else//unknown compiler
66 typedef signed long long sint64;
67 typedef unsigned long long uint64;
70 typedef signed char int8;
71 typedef signed short int16;
72 typedef signed int int32;
75 typedef unsigned char uint8;
76 typedef unsigned short uint16;
77 typedef unsigned int uint32;
81 typedef signed int lowp_int_t;
82 typedef signed int mediump_int_t;
83 typedef signed int highp_int_t;
85 typedef unsigned int lowp_uint_t;
86 typedef unsigned int mediump_uint_t;
87 typedef unsigned int highp_uint_t;
89 # if GLM_HAS_MAKE_SIGNED
90 using std::make_signed;
91 using std::make_unsigned;
93 # else//GLM_HAS_MAKE_SIGNED
94 template <
typename genType>
99 struct make_signed<char>
105 struct make_signed<short>
111 struct make_signed<int>
117 struct make_signed<long>
123 struct make_signed<long long>
125 typedef long long type;
129 struct make_signed<unsigned char>
135 struct make_signed<unsigned short>
141 struct make_signed<unsigned int>
147 struct make_signed<unsigned long>
153 struct make_signed<unsigned long long>
155 typedef long long type;
158 template <
typename genType>
163 struct make_unsigned<char>
165 typedef unsigned char type;
169 struct make_unsigned<short>
171 typedef unsigned short type;
175 struct make_unsigned<int>
177 typedef unsigned int type;
181 struct make_unsigned<long>
183 typedef unsigned long type;
187 struct make_unsigned<long long>
189 typedef unsigned long long type;
193 struct make_unsigned<unsigned char>
195 typedef unsigned char type;
199 struct make_unsigned<unsigned short>
201 typedef unsigned short type;
205 struct make_unsigned<unsigned int>
207 typedef unsigned int type;
211 struct make_unsigned<unsigned long>
213 typedef unsigned long type;
217 struct make_unsigned<unsigned long long>
219 typedef unsigned long long type;
221 # endif//GLM_HAS_MAKE_SIGNED
279 #if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
280 typedef mediump_int int_t;
281 #elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
282 typedef highp_int int_t;
283 #elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
284 typedef mediump_int int_t;
285 #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
286 typedef lowp_int int_t;
288 # error "GLM error: multiple default precision requested for signed interger types"
291 #if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
292 typedef mediump_uint uint_t;
293 #elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
294 typedef highp_uint uint_t;
295 #elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
296 typedef mediump_uint uint_t;
297 #elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
298 typedef lowp_uint uint_t;
300 # error "GLM error: multiple default precision requested for unsigned interger types"
312 #ifndef GLM_STATIC_ASSERT_NULL
313 GLM_STATIC_ASSERT(
sizeof(
glm::int8) == 1,
"int8 size isn't 1 byte on this platform");
314 GLM_STATIC_ASSERT(
sizeof(
glm::int16) == 2,
"int16 size isn't 2 bytes on this platform");
315 GLM_STATIC_ASSERT(
sizeof(
glm::int32) == 4,
"int32 size isn't 4 bytes on this platform");
316 GLM_STATIC_ASSERT(
sizeof(
glm::int64) == 8,
"int64 size isn't 8 bytes on this platform");
318 GLM_STATIC_ASSERT(
sizeof(
glm::uint8) == 1,
"uint8 size isn't 1 byte on this platform");
319 GLM_STATIC_ASSERT(
sizeof(
glm::uint16) == 2,
"uint16 size isn't 2 bytes on this platform");
320 GLM_STATIC_ASSERT(
sizeof(
glm::uint32) == 4,
"uint32 size isn't 4 bytes on this platform");
321 GLM_STATIC_ASSERT(
sizeof(
glm::uint64) == 8,
"uint64 size isn't 8 bytes on this platform");
322 #endif//GLM_STATIC_ASSERT_NULL
detail::mediump_int_t mediump_int
Medium precision signed integer.
detail::uint64 uint64_t
64 bit unsigned integer type.
detail::highp_int_t highp_int
High precision signed integer.
detail::uint32 uint32_t
32 bit unsigned integer type.
detail::int32 int32_t
32 bit signed integer type.
detail::uint16 uint16
16 bit unsigned integer type.
detail::uint16 uint16_t
16 bit unsigned integer type.
unsigned int uint
Unsigned integer type.
detail::uint64 uint64
64 bit unsigned integer type.
detail::int16 int16_t
16 bit signed integer type.
detail::uint8 uint8
8 bit unsigned integer type.
detail::uint32 uint32
32 bit unsigned integer type.
detail::int8 int8
8 bit signed integer type.
detail::lowp_uint_t lowp_uint
Low precision unsigned integer.
detail::lowp_int_t lowp_int
Low precision signed integer.
detail::int32 int32
32 bit signed integer type.
detail::int16 int16
16 bit signed integer type.
detail::int64 int64_t
64 bit signed integer type.
detail::mediump_uint_t mediump_uint
Medium precision unsigned integer.
detail::highp_uint_t highp_uint
High precision unsigned integer.
detail::int8 int8_t
8 bit signed integer type.
OpenGL Mathematics (glm.g-truc.net)
detail::uint8 uint8_t
8 bit unsigned integer type.
detail::int64 int64
64 bit signed integer type.