scalar_uint_sized.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /// @ref ext_scalar_uint_sized
  2. /// @file glm/ext/scalar_uint_sized.hpp
  3. ///
  4. /// @defgroup ext_scalar_uint_sized GLM_EXT_scalar_uint_sized
  5. /// @ingroup ext
  6. ///
  7. /// Exposes sized unsigned integer scalar types.
  8. ///
  9. /// Include <glm/ext/scalar_uint_sized.hpp> to use the features of this extension.
  10. ///
  11. /// @see ext_scalar_int_sized
  12. #pragma once
  13. #include "../detail/setup.hpp"
  14. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  15. # pragma message("GLM: GLM_EXT_scalar_uint_sized extension included")
  16. #endif
  17. namespace glm{
  18. namespace detail
  19. {
  20. # if GLM_HAS_EXTENDED_INTEGER_TYPE
  21. typedef std::uint8_t uint8;
  22. typedef std::uint16_t uint16;
  23. typedef std::uint32_t uint32;
  24. # else
  25. typedef unsigned char uint8;
  26. typedef unsigned short uint16;
  27. typedef unsigned int uint32;
  28. #endif
  29. template<>
  30. struct is_int<uint8>
  31. {
  32. enum test {value = ~0};
  33. };
  34. template<>
  35. struct is_int<uint16>
  36. {
  37. enum test {value = ~0};
  38. };
  39. template<>
  40. struct is_int<uint64>
  41. {
  42. enum test {value = ~0};
  43. };
  44. }//namespace detail
  45. /// @addtogroup ext_scalar_uint_sized
  46. /// @{
  47. /// 8 bit unsigned integer type.
  48. typedef detail::uint8 uint8;
  49. /// 16 bit unsigned integer type.
  50. typedef detail::uint16 uint16;
  51. /// 32 bit unsigned integer type.
  52. typedef detail::uint32 uint32;
  53. /// 64 bit unsigned integer type.
  54. typedef detail::uint64 uint64;
  55. /// @}
  56. }//namespace glm