glm.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2005-01-14
  5. // Updated : 2011-01-19
  6. // Licence : This source is under MIT License
  7. // File : glm/glm.hpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include "core/_fixes.hpp"
  10. #ifndef glm_glm
  11. #define glm_glm
  12. //! TODO: to delete
  13. #define GLMvalType typename genType::value_type
  14. //#define GLMcolType typename genType::col_type
  15. //#define GLMrowType typename genType::row_type
  16. #include <cmath>
  17. #include <climits>
  18. #include <cfloat>
  19. #include <limits>
  20. #include "setup.hpp"
  21. #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
  22. # define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
  23. # pragma message("GLM: Core library included")
  24. #endif//GLM_MESSAGE
  25. //! GLM namespace, it contains all GLSL based features.
  26. namespace glm
  27. {
  28. namespace test
  29. {
  30. bool main_bug();
  31. bool main_core();
  32. }//namespace test
  33. //! GLM core. Namespace that includes all the feature define by GLSL 4.10.6 specification. This namespace is included in glm namespace.
  34. namespace core
  35. {
  36. //! Scalar, vectors and matrices
  37. //! from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section,
  38. //! 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification.
  39. //! This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification.
  40. namespace type{}
  41. //! Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification.
  42. //! Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions.
  43. namespace function{}
  44. }
  45. //namespace core
  46. //! G-Truc Creation stable extensions.
  47. namespace gtc{}
  48. //! G-Truc Creation experimental extensions.
  49. //! The interface could change between releases.
  50. namespace gtx{}
  51. //! VIRTREV extensions.
  52. namespace img{}
  53. } //namespace glm
  54. #include "./core/_detail.hpp"
  55. #include "./core/type.hpp"
  56. #include "./core/func_trigonometric.hpp"
  57. #include "./core/func_exponential.hpp"
  58. #include "./core/func_common.hpp"
  59. #include "./core/func_packing.hpp"
  60. #include "./core/func_geometric.hpp"
  61. #include "./core/func_matrix.hpp"
  62. #include "./core/func_vector_relational.hpp"
  63. #include "./core/func_integer.hpp"
  64. #include "./core/func_noise.hpp"
  65. #include "./core/_swizzle.hpp"
  66. namespace glm
  67. {
  68. using namespace core::type;
  69. using namespace core::type::precision;
  70. using namespace core::function;
  71. } //namespace glm
  72. ////////////////////
  73. // check type sizes
  74. #ifndef GLM_STATIC_ASSERT_NULL
  75. GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
  76. GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
  77. GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
  78. GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
  79. GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
  80. GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
  81. GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
  82. GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
  83. GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
  84. GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
  85. GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
  86. #endif//GLM_STATIC_ASSERT_NULL
  87. #endif //glm_glm