1 #ifndef GLM_SETUP_INCLUDED 6 #define GLM_VERSION_MAJOR 0 7 #define GLM_VERSION_MINOR 9 8 #define GLM_VERSION_PATCH 9 9 #define GLM_VERSION_REVISION 1 10 #define GLM_VERSION 991 11 #define GLM_VERSION_MESSAGE "GLM: version 0.9.9.1" 13 #define GLM_SETUP_INCLUDED GLM_VERSION 24 #if defined(GLM_FORCE_MESSAGES) 25 # define GLM_MESSAGES GLM_ENABLE 27 # define GLM_MESSAGES GLM_DISABLE 33 #include "../simd/platform.h" 38 #if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) 39 # define GLM_MODEL GLM_MODEL_64 40 #elif defined(__i386__) || defined(__ppc__) 41 # define GLM_MODEL GLM_MODEL_32 43 # define GLM_MODEL GLM_MODEL_32 46 #if !defined(GLM_MODEL) && GLM_COMPILER != 0 47 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." 55 #define GLM_LANG_CXX98_FLAG (1 << 1) 56 #define GLM_LANG_CXX03_FLAG (1 << 2) 57 #define GLM_LANG_CXX0X_FLAG (1 << 3) 58 #define GLM_LANG_CXX11_FLAG (1 << 4) 59 #define GLM_LANG_CXX14_FLAG (1 << 5) 60 #define GLM_LANG_CXX17_FLAG (1 << 6) 61 #define GLM_LANG_CXX2A_FLAG (1 << 7) 62 #define GLM_LANG_CXXMS_FLAG (1 << 8) 63 #define GLM_LANG_CXXGNU_FLAG (1 << 9) 65 #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG 66 #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) 67 #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) 68 #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) 69 #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) 70 #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) 71 #define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG) 72 #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG 73 #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG 75 #if (defined(_MSC_EXTENSIONS)) 76 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG 77 #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) 78 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG 80 # define GLM_LANG_EXT 0 83 #if (defined(GLM_FORCE_CXX_UNKNOWN)) 85 #elif defined(GLM_FORCE_CXX2A) 86 # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) 87 # define GLM_LANG_STL11_FORCED 88 #elif defined(GLM_FORCE_CXX17) 89 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) 90 # define GLM_LANG_STL11_FORCED 91 #elif defined(GLM_FORCE_CXX14) 92 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) 93 # define GLM_LANG_STL11_FORCED 94 #elif defined(GLM_FORCE_CXX11) 95 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) 96 # define GLM_LANG_STL11_FORCED 97 #elif defined(GLM_FORCE_CXX03) 98 # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) 99 #elif defined(GLM_FORCE_CXX98) 100 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) 102 # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) 103 # if GLM_COMPILER >= GLM_COMPILER_VC15_7 104 # define GLM_LANG_PLATFORM _MSVC_LANG 105 # elif GLM_COMPILER >= GLM_COMPILER_VC15 106 # if _MSVC_LANG > 201402L 107 # define GLM_LANG_PLATFORM 201402L 109 # define GLM_LANG_PLATFORM _MSVC_LANG 112 # define GLM_LANG_PLATFORM 0 115 # define GLM_LANG_PLATFORM 0 118 # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L 119 # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) 120 # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L 121 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) 122 # elif __cplusplus == 201402L || GLM_LANG_PLATFORM == 201402L 123 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) 124 # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L 125 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) 126 # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) 127 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) 128 # elif __cplusplus == 199711L 129 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) 131 # define GLM_LANG (0 | GLM_LANG_EXT) 143 #if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) 144 # define GLM_HAS_CXX11_STL 0 145 #elif GLM_COMPILER & GLM_COMPILER_CLANG 146 # if (defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED) 147 # define GLM_HAS_CXX11_STL 1 149 # define GLM_HAS_CXX11_STL 0 151 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 152 # define GLM_HAS_CXX11_STL 1 154 # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 155 ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ 156 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ 157 ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))) 161 #if GLM_COMPILER & GLM_COMPILER_CLANG 162 # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) 163 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 164 # define GLM_HAS_STATIC_ASSERT 1 166 # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 167 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ 168 ((GLM_COMPILER & GLM_COMPILER_VC)))) 172 #if GLM_LANG & GLM_LANG_CXX11_FLAG 173 # define GLM_HAS_EXTENDED_INTEGER_TYPE 1 175 # define GLM_HAS_EXTENDED_INTEGER_TYPE (\ 176 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ 177 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ 178 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG))) 182 #if GLM_COMPILER & GLM_COMPILER_CLANG 183 # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) 184 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 185 # define GLM_HAS_INITIALIZER_LISTS 1 187 # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 188 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ 189 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ 190 ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)))) 194 #if GLM_COMPILER & GLM_COMPILER_CLANG 195 # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) 196 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 197 # define GLM_HAS_UNRESTRICTED_UNIONS 1 199 # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 200 (GLM_COMPILER & GLM_COMPILER_VC) || \ 201 ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75))) 205 #if GLM_COMPILER & GLM_COMPILER_CLANG 206 # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) 207 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 208 # define GLM_HAS_DEFAULTED_FUNCTIONS 1 210 # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 211 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ 212 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ 213 (GLM_COMPILER & GLM_COMPILER_CUDA))) 217 #if GLM_COMPILER & GLM_COMPILER_CLANG 218 # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) 219 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 220 # define GLM_HAS_RVALUE_REFERENCES 1 222 # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 223 ((GLM_COMPILER & GLM_COMPILER_VC)) || \ 224 ((GLM_COMPILER & GLM_COMPILER_CUDA)))) 228 #if GLM_COMPILER & GLM_COMPILER_CLANG 229 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) 230 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 231 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 233 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 234 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ 235 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ 236 ((GLM_COMPILER & GLM_COMPILER_CUDA)))) 240 #if GLM_COMPILER & GLM_COMPILER_CLANG 241 # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) 242 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 243 # define GLM_HAS_TEMPLATE_ALIASES 1 245 # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 246 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ 247 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ 248 ((GLM_COMPILER & GLM_COMPILER_CUDA)))) 252 #if GLM_COMPILER & GLM_COMPILER_CLANG 253 # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) 254 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 255 # define GLM_HAS_RANGE_FOR 1 257 # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 258 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ 259 ((GLM_COMPILER & GLM_COMPILER_VC)) || \ 260 ((GLM_COMPILER & GLM_COMPILER_CUDA)))) 264 #if GLM_COMPILER & GLM_COMPILER_CLANG 265 # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) 266 #elif GLM_LANG & GLM_LANG_CXX11_FLAG 267 # define GLM_HAS_ALIGNOF 1 269 # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 270 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ 271 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ 272 ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70)))) 277 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... 278 # define GLM_HAS_CONSTEXPR 0 279 #elif (GLM_COMPILER & GLM_COMPILER_CLANG) 280 # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) 281 #elif (GLM_LANG & GLM_LANG_CXX14_FLAG) 282 # define GLM_HAS_CONSTEXPR 1 284 # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ 285 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ 286 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) 289 #if GLM_HAS_CONSTEXPR 290 # define GLM_CONSTEXPR constexpr 292 # define GLM_CONSTEXPR 296 #if GLM_LANG & GLM_LANG_CXX11_FLAG 297 # define GLM_HAS_ASSIGNABLE 1 299 # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 300 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ 301 ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) 305 #define GLM_HAS_TRIVIAL_QUERIES 0 308 #if GLM_LANG & GLM_LANG_CXX11_FLAG 309 # define GLM_HAS_MAKE_SIGNED 1 311 # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ 312 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ 313 ((GLM_COMPILER & GLM_COMPILER_CUDA)))) 317 #if defined(GLM_FORCE_PURE) 318 # define GLM_HAS_BITSCAN_WINDOWS 0 320 # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ 321 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ 322 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) 328 # if GLM_COMPILER & GLM_COMPILER_GCC 329 # if GLM_COMPILER >= GLM_COMPILER_GCC61 330 # define GLM_HAS_OPENMP 45 331 # elif GLM_COMPILER >= GLM_COMPILER_GCC49 332 # define GLM_HAS_OPENMP 40 333 # elif GLM_COMPILER >= GLM_COMPILER_GCC47 334 # define GLM_HAS_OPENMP 31 336 # define GLM_HAS_OPENMP 0 338 # elif GLM_COMPILER & GLM_COMPILER_CLANG 339 # if GLM_COMPILER >= GLM_COMPILER_CLANG38 340 # define GLM_HAS_OPENMP 31 342 # define GLM_HAS_OPENMP 0 344 # elif GLM_COMPILER & GLM_COMPILER_VC 345 # define GLM_HAS_OPENMP 20 346 # elif GLM_COMPILER & GLM_COMPILER_INTEL 347 # if GLM_COMPILER >= GLM_COMPILER_INTEL16 348 # define GLM_HAS_OPENMP 40 350 # define GLM_HAS_OPENMP 0 353 # define GLM_HAS_OPENMP 0 356 # define GLM_HAS_OPENMP 0 362 #if GLM_LANG & GLM_LANG_CXX0X_FLAG 363 # define GLM_CONFIG_NULLPTR GLM_ENABLE 365 # define GLM_CONFIG_NULLPTR GLM_DISABLE 368 #if GLM_CONFIG_NULLPTR == GLM_ENABLE 369 # define GLM_NULLPTR nullptr 371 # define GLM_NULLPTR 0 377 #if GLM_HAS_STATIC_ASSERT 378 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message) 379 #elif GLM_COMPILER & GLM_COMPILER_VC 380 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] 382 # define GLM_STATIC_ASSERT(x, message) assert(x) 388 #if GLM_COMPILER & GLM_COMPILER_CUDA 389 # define GLM_CUDA_FUNC_DEF __device__ __host__ 390 # define GLM_CUDA_FUNC_DECL __device__ __host__ 392 # define GLM_CUDA_FUNC_DEF 393 # define GLM_CUDA_FUNC_DECL 396 #if defined(GLM_FORCE_INLINE) 397 # if GLM_COMPILER & GLM_COMPILER_VC 398 # define GLM_INLINE __forceinline 399 # define GLM_NEVER_INLINE __declspec((noinline)) 400 # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) 401 # define GLM_INLINE inline __attribute__((__always_inline__)) 402 # define GLM_NEVER_INLINE __attribute__((__noinline__)) 403 # elif GLM_COMPILER & GLM_COMPILER_CUDA 404 # define GLM_INLINE __forceinline__ 405 # define GLM_NEVER_INLINE __noinline__ 407 # define GLM_INLINE inline 408 # define GLM_NEVER_INLINE 409 # endif//GLM_COMPILER 411 # define GLM_INLINE inline 412 # define GLM_NEVER_INLINE 413 #endif//defined(GLM_FORCE_INLINE) 415 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL 416 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE 423 #define GLM_SWIZZLE_DISABLED 0 424 #define GLM_SWIZZLE_OPERATOR 1 425 #define GLM_SWIZZLE_FUNCTION 2 427 #if defined(GLM_FORCE_XYZW_ONLY) 428 # undef GLM_FORCE_SWIZZLE 431 #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) 432 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR 433 #elif defined(GLM_FORCE_SWIZZLE) 434 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION 436 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED 444 #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE 445 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE 447 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE 456 #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE 457 #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE 458 #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan 459 #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM 461 #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) 462 #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) 463 #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) 464 #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) 466 #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE 467 # ifdef GLM_FORCE_LEFT_HANDED 468 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO 470 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO 473 # ifdef GLM_FORCE_LEFT_HANDED 474 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO 476 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO 483 #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) 484 # define GLM_DEPRECATED __declspec(deprecated) 485 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name 486 #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) 487 # define GLM_DEPRECATED __attribute__((__deprecated__)) 488 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) 489 #elif GLM_COMPILER & GLM_COMPILER_CUDA 490 # define GLM_DEPRECATED 491 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) 493 # define GLM_DEPRECATED 494 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name 499 #ifdef GLM_FORCE_EXPLICIT_CTOR 500 # define GLM_EXPLICIT explicit 502 # define GLM_EXPLICIT 510 #define GLM_LENGTH_INT 1 511 #define GLM_LENGTH_SIZE_T 2 513 #ifdef GLM_FORCE_SIZE_T_LENGTH 514 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T 516 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT 522 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T 523 typedef size_t length_t;
525 typedef int length_t;
532 #if GLM_HAS_CONSTEXPR 533 # define GLM_CONFIG_CONSTEXP GLM_ENABLE 537 template<
typename T, std::
size_t N>
538 constexpr std::size_t countof(T
const (&)[N])
543 # define GLM_COUNTOF(arr) glm::countof(arr) 544 #elif defined(_MSC_VER) 545 # define GLM_CONFIG_CONSTEXP GLM_DISABLE 547 # define GLM_COUNTOF(arr) _countof(arr) 549 # define GLM_CONFIG_CONSTEXP GLM_DISABLE 551 # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) 563 enum test {value = 0};
567 struct is_int<unsigned int>
569 enum test {value = ~0};
573 struct is_int<signed int>
575 enum test {value = ~0};
579 typedef unsigned int uint;
585 #if GLM_HAS_EXTENDED_INTEGER_TYPE 592 # if GLM_HAS_EXTENDED_INTEGER_TYPE 595 # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available 598 # elif GLM_COMPILER & GLM_COMPILER_VC 599 typedef unsigned __int64
uint64;
600 typedef signed __int64
int64;
601 # elif GLM_COMPILER & GLM_COMPILER_GCC 602 # pragma GCC diagnostic ignored "-Wlong-long" 603 __extension__
typedef unsigned long long uint64;
604 __extension__
typedef signed long long int64;
605 # elif (GLM_COMPILER & GLM_COMPILER_CLANG) 606 # pragma clang diagnostic ignored "-Wc++11-long-long" 607 typedef unsigned long long uint64;
608 typedef signed long long int64;
609 # else//unknown compiler 610 typedef unsigned long long uint64;
611 typedef signed long long int64;
619 #if GLM_HAS_MAKE_SIGNED 620 # include <type_traits> 625 using std::make_unsigned;
634 template<
typename genType>
639 struct make_unsigned<char>
641 typedef unsigned char type;
645 struct make_unsigned<short>
647 typedef unsigned short type;
651 struct make_unsigned<int>
653 typedef unsigned int type;
657 struct make_unsigned<long>
659 typedef unsigned long type;
663 struct make_unsigned<
int64>
669 struct make_unsigned<unsigned char>
671 typedef unsigned char type;
675 struct make_unsigned<unsigned short>
677 typedef unsigned short type;
681 struct make_unsigned<unsigned int>
683 typedef unsigned int type;
687 struct make_unsigned<unsigned long>
689 typedef unsigned long type;
693 struct make_unsigned<
uint64>
704 #ifdef GLM_FORCE_XYZW_ONLY 705 # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE 707 # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE 713 #define GLM_CTOR_INITIALIZER_LIST (1 << 1) 714 #define GLM_CTOR_INITIALISATION (1 << 2) 716 #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS 717 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST 718 #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS 719 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION 721 # define GLM_CONFIG_CTOR_INIT GLM_DISABLE 727 #if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_DISABLE 728 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE 729 # define GLM_DEFAULT = default 731 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE 738 #ifdef GLM_FORCE_ALIGNED // Legacy define 739 # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES 742 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) 743 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE 745 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE 751 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) 752 # define GLM_CONFIG_SIMD GLM_ENABLE 754 # define GLM_CONFIG_SIMD GLM_DISABLE 760 #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) 761 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE 763 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE 770 #define GLM_MEDIUMP 2 773 #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) 774 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP 775 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) 776 # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP 777 #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) 778 # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP 780 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP 783 #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) 784 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP 785 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) 786 # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP 787 #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) 788 # define GLM_CONFIG_PRECISION_INT GLM_LOWP 790 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP 793 #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) 794 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP 795 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) 796 # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP 797 #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) 798 # define GLM_CONFIG_PRECISION_UINT GLM_LOWP 800 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP 803 #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) 804 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP 805 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) 806 # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP 807 #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) 808 # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP 810 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP 813 #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) 814 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP 815 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) 816 # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP 817 #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) 818 # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP 820 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP 826 #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) 827 # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." 828 #elif GLM_SETUP_INCLUDED == GLM_VERSION 833 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) 834 # define GLM_MESSAGE_DISPLAYED 835 # define GLM_STR_HELPER(x) #x 836 # define GLM_STR(x) GLM_STR_HELPER(x) 839 # pragma message (GLM_STR(GLM_VERSION_MESSAGE)) 842 # if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) 843 # pragma message("GLM: C++ 2A with extensions") 844 # elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) 845 # pragma message("GLM: C++ 2A") 846 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) 847 # pragma message("GLM: C++ 17 with extensions") 848 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) 849 # pragma message("GLM: C++ 17") 850 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) 851 # pragma message("GLM: C++ 14 with extensions") 852 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) 853 # pragma message("GLM: C++ 14") 854 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) 855 # pragma message("GLM: C++ 11 with extensions") 856 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) 857 # pragma message("GLM: C++ 11") 858 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) 859 # pragma message("GLM: C++ 0x with extensions") 860 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) 861 # pragma message("GLM: C++ 0x") 862 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) 863 # pragma message("GLM: C++ 03 with extensions") 864 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) 865 # pragma message("GLM: C++ 03") 866 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) 867 # pragma message("GLM: C++ 98 with extensions") 868 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) 869 # pragma message("GLM: C++ 98") 871 # pragma message("GLM: C++ language undetected") 875 # if GLM_COMPILER & GLM_COMPILER_CUDA 876 # pragma message("GLM: CUDA compiler detected") 877 # elif GLM_COMPILER & GLM_COMPILER_VC 878 # pragma message("GLM: Visual C++ compiler detected") 879 # elif GLM_COMPILER & GLM_COMPILER_CLANG 880 # pragma message("GLM: Clang compiler detected") 881 # elif GLM_COMPILER & GLM_COMPILER_INTEL 882 # pragma message("GLM: Intel Compiler detected") 883 # elif GLM_COMPILER & GLM_COMPILER_GCC 884 # pragma message("GLM: GCC compiler detected") 886 # pragma message("GLM: Compiler not detected") 890 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) 891 # pragma message("GLM: x86 64 bits with AVX2 instruction set build target") 892 # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) 893 # pragma message("GLM: x86 32 bits with AVX2 instruction set build target") 895 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) 896 # pragma message("GLM: x86 64 bits with AVX instruction set build target") 897 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) 898 # pragma message("GLM: x86 32 bits with AVX instruction set build target") 900 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) 901 # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") 902 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) 903 # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") 905 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) 906 # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") 907 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) 908 # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") 910 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) 911 # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") 912 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) 913 # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") 915 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) 916 # pragma message("GLM: x86 64 bits with SSE3 instruction set build target") 917 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) 918 # pragma message("GLM: x86 32 bits with SSE3 instruction set build target") 920 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) 921 # pragma message("GLM: x86 64 bits with SSE2 instruction set build target") 922 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) 923 # pragma message("GLM: x86 32 bits with SSE2 instruction set build target") 925 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) 926 # pragma message("GLM: x86 64 bits build target") 927 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) 928 # pragma message("GLM: x86 32 bits build target") 930 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) 931 # pragma message("GLM: ARM 64 bits with Neon instruction set build target") 932 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) 933 # pragma message("GLM: ARM 32 bits with Neon instruction set build target") 935 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) 936 # pragma message("GLM: ARM 64 bits build target") 937 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) 938 # pragma message("GLM: ARM 32 bits build target") 940 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) 941 # pragma message("GLM: MIPS 64 bits build target") 942 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) 943 # pragma message("GLM: MIPS 32 bits build target") 945 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) 946 # pragma message("GLM: PowerPC 64 bits build target") 947 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) 948 # pragma message("GLM: PowerPC 32 bits build target") 950 # pragma message("GLM: Unknown build target") 954 # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) 955 # pragma message("GLM: QNX platform detected") 958 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) 959 # pragma message("GLM: Apple platform detected") 960 # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) 961 # pragma message("GLM: WinCE platform detected") 962 # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) 963 # pragma message("GLM: Windows platform detected") 964 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) 965 # pragma message("GLM: Native Client detected") 966 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) 967 # pragma message("GLM: Android platform detected") 968 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) 969 # pragma message("GLM: Linux platform detected") 970 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) 971 # pragma message("GLM: UNIX platform detected") 972 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) 973 # pragma message("GLM: platform unknown") 975 # pragma message("GLM: platform not detected") 979 # if defined GLM_FORCE_XYZW_ONLY 980 # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets") 984 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR 985 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled") 986 # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION 987 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") 989 # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") 993 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T 994 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") 996 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") 999 # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE 1000 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") 1002 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") 1005 # ifdef GLM_FORCE_SINGLE_ONLY 1006 # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types") 1009 # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) 1010 # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES 1011 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions") 1014 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT 1015 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") 1017 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") 1020 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT 1021 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") 1023 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") 1025 #endif//GLM_MESSAGES 1027 #endif//GLM_SETUP_INCLUDED detail::uint64 uint64
64 bit unsigned integer type.
int64 int64_t
64 bit signed integer type.
detail::int64 int64
64 bit signed integer type.
uint64 uint64_t
Default qualifier 64 bit unsigned integer type.