diff --git a/glm/detail/compute_common.hpp b/glm/detail/compute_common.hpp index 232f118d..38869912 100644 --- a/glm/detail/compute_common.hpp +++ b/glm/detail/compute_common.hpp @@ -16,7 +16,7 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) { GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || std::numeric_limits::is_signed || GLM_UNRESTRICTED_GENTYPE, + std::numeric_limits::is_iec559 || std::numeric_limits::is_signed || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'abs' only accept floating-point and integer scalar or vector inputs"); return x >= genFIType(0) ? x : -x; @@ -41,7 +41,7 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) { GLM_STATIC_ASSERT( - (!std::numeric_limits::is_signed && std::numeric_limits::is_integer) || GLM_UNRESTRICTED_GENTYPE, + (!std::numeric_limits::is_signed && std::numeric_limits::is_integer) || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'abs' only accept floating-point and integer scalar or vector inputs"); return x; } diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index a2ced196..c6a1527b 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -15,7 +15,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType min(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); return (y < x) ? y : x; } @@ -23,7 +23,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType max(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); return (x < y) ? y : x; } @@ -81,7 +81,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); return vec(vec(x) + a * vec(y - x)); } @@ -104,7 +104,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); return vec(vec(x) + a * vec(y - x)); } @@ -124,7 +124,7 @@ namespace detail { GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); return static_cast(static_cast(x) + a * static_cast(y - x)); } @@ -258,7 +258,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); } @@ -474,7 +474,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec min(vec const& a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); return detail::compute_min_vector::value>::call(a, vec(b)); } @@ -488,7 +488,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec max(vec const& a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); return detail::compute_max_vector::value>::call(a, vec(b)); } @@ -502,21 +502,21 @@ namespace detail template GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); return min(max(x, minVal), maxVal); } template GLM_FUNC_QUALIFIER vec clamp(vec const& x, T minVal, T maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); } template GLM_FUNC_QUALIFIER vec clamp(vec const& x, vec const& minVal, vec const& maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); } @@ -561,7 +561,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); return tmp * tmp * (genType(3) - genType(2) * tmp); @@ -745,7 +745,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); return std::frexp(x, &exp); } @@ -753,7 +753,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); vec Result; for (length_t l = 0; l < v.length(); ++l) @@ -764,7 +764,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); return std::ldexp(x, exp); } @@ -772,7 +772,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); vec Result; for (length_t l = 0; l < v.length(); ++l) @@ -781,6 +781,6 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_common_simd.inl" #endif diff --git a/glm/detail/func_exponential.inl b/glm/detail/func_exponential.inl index a847e63f..2040d41f 100644 --- a/glm/detail/func_exponential.inl +++ b/glm/detail/func_exponential.inl @@ -146,7 +146,7 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_exponential_simd.inl" #endif diff --git a/glm/detail/func_exponential_simd.inl b/glm/detail/func_exponential_simd.inl index a9adea22..fb789517 100644 --- a/glm/detail/func_exponential_simd.inl +++ b/glm/detail/func_exponential_simd.inl @@ -19,7 +19,7 @@ namespace detail } }; -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_sqrt<4, float, aligned_lowp, true> { diff --git a/glm/detail/func_geometric.inl b/glm/detail/func_geometric.inl index cc9e57df..05c18d6b 100644 --- a/glm/detail/func_geometric.inl +++ b/glm/detail/func_geometric.inl @@ -242,6 +242,6 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_geometric_simd.inl" #endif diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index d02a5e1b..ffed21a6 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -372,7 +372,7 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_integer_simd.inl" #endif diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index c946f0a9..e38f3ee4 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -358,14 +358,14 @@ namespace detail template GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); return detail::compute_matrixCompMult::value>::call(x, y); } template GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); typename detail::outerProduct_trait::type m; for(length_t i = 0; i < m.length(); ++i) @@ -376,26 +376,26 @@ namespace detail template GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); return detail::compute_transpose::value>::call(m); } template GLM_FUNC_QUALIFIER T determinant(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); return detail::compute_determinant::value>::call(m); } template GLM_FUNC_QUALIFIER mat inverse(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); return detail::compute_inverse::value>::call(m); } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_matrix_simd.inl" #endif diff --git a/glm/detail/func_matrix_simd.inl b/glm/detail/func_matrix_simd.inl index 0a6aaf47..d87f75e8 100644 --- a/glm/detail/func_matrix_simd.inl +++ b/glm/detail/func_matrix_simd.inl @@ -59,7 +59,7 @@ namespace detail }; }//namespace detail -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) { diff --git a/glm/detail/func_packing.inl b/glm/detail/func_packing.inl index 1904d968..cb3f8eff 100644 --- a/glm/detail/func_packing.inl +++ b/glm/detail/func_packing.inl @@ -184,7 +184,7 @@ namespace glm } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_packing_simd.inl" #endif diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index 5ec5a08d..ee5ba7a2 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -194,7 +194,7 @@ namespace glm } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_trigonometric_simd.inl" #endif diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index 1b256eda..d0c28515 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -107,6 +107,6 @@ namespace glm } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_vector_relational_simd.inl" #endif diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index 8c31c6dd..ce664348 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -15,7 +15,7 @@ namespace glm packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance @@ -27,7 +27,7 @@ namespace glm lowp = packed_lowp, ///< By default lowp qualifier is also packed packed = packed_highp, ///< By default packed qualifier is also high precision -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) defaultp = aligned_highp # else defaultp = highp @@ -47,7 +47,7 @@ namespace detail static const bool value = false; }; -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct is_aligned { diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 8284db5e..3d938783 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -381,12 +381,12 @@ // nullptr #if GLM_LANG & GLM_LANG_CXX0X_FLAG -# define GLM_USE_NULLPTR GLM_ENABLE +# define GLM_CONFIG_NULLPTR GLM_ENABLE #else -# define GLM_USE_NULLPTR GLM_DISABLE +# define GLM_CONFIG_NULLPTR GLM_DISABLE #endif -#if GLM_USE_NULLPTR == GLM_ENABLE +#if GLM_CONFIG_NULLPTR == GLM_ENABLE # define GLM_NULLPTR nullptr #else # define GLM_NULLPTR 0 @@ -442,15 +442,16 @@ // User defines: GLM_FORCE_SWIZZLE -#define GLM_SWIZZLE_OPERATOR 1 -#define GLM_SWIZZLE_FUNCTION 2 +#define GLM_SWIZZLE_DISABLED 0 +#define GLM_SWIZZLE_OPERATOR 1 +#define GLM_SWIZZLE_FUNCTION 2 #if defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) -# define GLM_SWIZZLE GLM_SWIZZLE_OPERATOR +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR #elif defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) -# define GLM_SWIZZLE GLM_SWIZZLE_FUNCTION +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION #else -# define GLM_SWIZZLE GLM_DISABLE +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED #endif /////////////////////////////////////////////////////////////////////////////////// @@ -459,35 +460,39 @@ // #define GLM_FORCE_UNRESTRICTED_GENTYPE #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE -# define GLM_UNRESTRICTED_GENTYPE GLM_ENABLE +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE #else -# define GLM_UNRESTRICTED_GENTYPE GLM_DISABLE +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM // to use a clip space between 0 to 1. - -#define GLM_DEPTH_ZERO_TO_ONE 0x00000001 -#define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002 - -#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE -# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_ZERO_TO_ONE -#else -# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_NEGATIVE_ONE_TO_ONE -#endif - -/////////////////////////////////////////////////////////////////////////////////// // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM // to use left handed coordinate system by default. -#define GLM_LEFT_HANDED 0x00000001 // For DirectX, Metal, Vulkan -#define GLM_RIGHT_HANDED 0x00000002 // For OpenGL, default in GLM +#define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE +#define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE +#define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan +#define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM -#ifdef GLM_FORCE_LEFT_HANDED -# define GLM_COORDINATE_SYSTEM GLM_LEFT_HANDED +#define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) +#define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) + +#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO +# endif #else -# define GLM_COORDINATE_SYSTEM GLM_RIGHT_HANDED +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO +# endif #endif /////////////////////////////////////////////////////////////////////////////////// @@ -520,12 +525,19 @@ // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise // length_t is a typedef of int like GLSL defines it. -// User define: GLM_FORCE_SIZE_T_LENGTH +#define GLM_LENGTH_INT 1 +#define GLM_LENGTH_SIZE_T 2 + +#ifdef GLM_FORCE_SIZE_T_LENGTH +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T +#else +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT +#endif namespace glm { using std::size_t; -# if defined(GLM_FORCE_SIZE_T_LENGTH) +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T typedef size_t length_t; # else typedef int length_t; @@ -536,7 +548,7 @@ namespace glm // constexpr #if GLM_HAS_CONSTEXPR -# define GLM_USE_CONSTEXP GLM_ENABLE +# define GLM_CONFIG_CONSTEXP GLM_ENABLE namespace glm { @@ -548,11 +560,11 @@ namespace glm }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) #elif defined(_MSC_VER) -# define GLM_USE_CONSTEXP GLM_DISABLE +# define GLM_CONFIG_CONSTEXP GLM_DISABLE # define GLM_COUNTOF(arr) _countof(arr) #else -# define GLM_USE_CONSTEXP GLM_DISABLE +# define GLM_CONFIG_CONSTEXP GLM_DISABLE # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) #endif @@ -564,21 +576,21 @@ namespace glm #define GLM_CTOR_INITIALISATION (1 << 2) #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS -# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALIZER_LIST +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS -# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALISATION +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION #else -# define GLM_USE_CTOR_INIT GLM_DISABLE +# define GLM_CONFIG_CTOR_INIT GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted function -#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_USE_CTOR_INIT == GLM_DISABLE -# define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE +#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_DISABLE +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE # define GLM_DEFAULT = default #else -# define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE # define GLM_DEFAULT #endif @@ -586,36 +598,36 @@ namespace glm // Configure the use of aligned gentypes #if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) -# define GLM_USE_ALIGNED_GENTYPES GLM_ENABLE +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE #else -# define GLM_USE_ALIGNED_GENTYPES GLM_DISABLE +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Use SIMD instruction sets #if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) -#define GLM_USE_SIMD GLM_ENABLE +#define GLM_CONFIG_SIMD GLM_ENABLE #else -#define GLM_USE_SIMD GLM_DISABLE +#define GLM_CONFIG_SIMD GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Only use x, y, z, w as vector type components #ifdef GLM_FORCE_XYZW_ONLY -# define GLM_USE_XYZW_ONLY GLM_ENABLE +# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE #else -# define GLM_USE_XYZW_ONLY GLM_DISABLE +# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of anonymous structure as implementation detail -#if ((GLM_USE_SIMD == GLM_ENABLE) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE)) -# define GLM_USE_ANONYMOUS_STRUCT GLM_ENABLE +#if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE #else -# define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// @@ -804,22 +816,22 @@ namespace glm # endif // Report swizzle operator support -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled") -# elif GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") # else # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") # endif // Report .length() type -# if defined GLM_FORCE_SIZE_T_LENGTH +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t instead of int.") # else # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following the GLSL specification. Define GLM_FORCE_SIZE_T_LENGTH to make glm::length_t, a typedef of std::size_t.") # endif -# ifdef GLM_FORCE_UNRESTRICTED_GENTYPE +# if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL specification restrictions on valid function genTypes.") # else # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL specification on valid function genTypes.") @@ -829,13 +841,13 @@ namespace glm # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types") # endif -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") # else # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") # endif -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") # else # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 1dc98302..d08caded 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -7,14 +7,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); # endif diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 88050267..4803f0f4 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); # endif diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 406b2723..47bfa8d7 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); # endif diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index cb3489b3..5d55654c 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index bdc35ee3..6883687d 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -7,14 +7,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 273dbee3..992cab69 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 17bb4546..cbad54da 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index c432fd2a..5794125f 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 76dba58b..9432cee9 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -7,14 +7,14 @@ namespace glm { // -- Constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} # endif { -# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); @@ -124,25 +124,25 @@ namespace glm : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} # endif { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); # if !GLM_HAS_INITIALIZER_LISTS this->value[0] = col_type(x1, y1, z1, w1); @@ -159,10 +159,10 @@ namespace glm : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} # endif { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); # if !GLM_HAS_INITIALIZER_LISTS this->value[0] = col_type(v1); @@ -704,6 +704,6 @@ namespace glm } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "type_mat4x4_simd.inl" #endif diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 9c20ed5d..81afb310 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -5,10 +5,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0) # endif {} @@ -76,7 +76,7 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) { diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index bbee1cb3..92f83a5c 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -4,9 +4,9 @@ #pragma once #include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" -#elif GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include @@ -24,9 +24,9 @@ namespace glm // -- Data -- -# if GLM_USE_XYZW_ONLY +# if GLM_CONFIG_XYZW_ONLY T x, y; -# elif GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y; }; @@ -35,7 +35,7 @@ namespace glm typename detail::storage<2, T, detail::is_aligned::value>::type data; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) @@ -51,9 +51,9 @@ namespace glm union {T x, r, s;}; union {T y, g, t;}; -# if GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) -# endif//GLM_SWIZZLE +# endif//GLM_CONFIG_SWIZZLE # endif // -- Component accesses -- @@ -106,13 +106,13 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); // -- Swizzle constructors -- -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) { *this = that(); } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 845f1502..b82063d6 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -7,10 +7,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0) # endif {} @@ -117,7 +117,7 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) { diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 553f2f7f..9ee68bc1 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -4,9 +4,9 @@ #pragma once #include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" -#elif GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include @@ -24,9 +24,9 @@ namespace glm // -- Data -- -# if GLM_USE_XYZW_ONLY +# if GLM_CONFIG_XYZW_ONLY T x, y, z; -# elif GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y, z; }; @@ -35,7 +35,7 @@ namespace glm typename detail::storage<3, T, detail::is_aligned::value>::type data; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) @@ -52,9 +52,9 @@ namespace glm union { T y, g, t; }; union { T z, b, p; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) -# endif//GLM_SWIZZLE +# endif//GLM_CONFIG_SWIZZLE # endif//GLM_LANG // -- Component accesses -- @@ -124,7 +124,7 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); // -- Swizzle constructors -- -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) { @@ -142,7 +142,7 @@ namespace glm { *this = vec(scalar, v()); } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 63e94141..ba6c9329 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -5,10 +5,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0) # endif {} @@ -179,7 +179,7 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) { diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index fee6a440..a64398c6 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -4,9 +4,9 @@ #pragma once #include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" -#elif GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include @@ -24,9 +24,9 @@ namespace glm // -- Data -- -# if GLM_USE_XYZW_ONLY +# if GLM_CONFIG_XYZW_ONLY T x, y, z, w; -# elif GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct { T x, y, z, w; }; @@ -35,7 +35,7 @@ namespace glm typename detail::storage<4, T, detail::is_aligned::value>::type data; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) @@ -53,7 +53,7 @@ namespace glm union { T z, b, p; }; union { T w, a, q; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) # endif # endif @@ -175,7 +175,7 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); // -- Swizzle constructors -- -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) { @@ -217,7 +217,7 @@ namespace glm { *this = vec<4, T, Q>(x, v()); } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 4e0a6834..e3314789 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -158,10 +158,10 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0), w(0) # endif {} @@ -518,7 +518,7 @@ namespace detail // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) { @@ -1142,6 +1142,6 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "type_vec4_simd.inl" #endif diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index 519a5167..3c474a40 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -6,7 +6,7 @@ namespace glm{ namespace detail { -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 { @@ -49,7 +49,7 @@ namespace detail return Result; } }; -# endif// GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template struct compute_vec4_add @@ -147,7 +147,7 @@ namespace detail }; # endif -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_vec4_div { @@ -345,7 +345,7 @@ namespace detail }; }//namespace detail -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : data(_mm_set1_ps(_s)) @@ -460,7 +460,7 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) {} -#endif// GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +#endif// GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE }//namespace glm #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/glm/ext.hpp b/glm/ext.hpp index ff02c784..5676b7cb 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -35,7 +35,7 @@ #include "./gtc/type_ptr.hpp" #include "./gtc/ulp.hpp" #include "./gtc/vec1.hpp" -#if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE # include "./gtc/type_aligned.hpp" #endif diff --git a/glm/ext/vec1.hpp b/glm/ext/vec1.hpp index 5d3205bf..de96685f 100644 --- a/glm/ext/vec1.hpp +++ b/glm/ext/vec1.hpp @@ -14,9 +14,9 @@ #include "../fwd.hpp" #include "../detail/type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "../detail/_swizzle.hpp" -#elif GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "../detail/_swizzle_func.hpp" #endif #include @@ -41,9 +41,9 @@ namespace glm // -- Data -- -# if GLM_USE_XYZW_ONLY +# if GLM_CONFIG_XYZW_ONLY T x; -# elif GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { T x; @@ -52,7 +52,7 @@ namespace glm typename detail::storage<1, T, detail::is_aligned::value>::type data; /* -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) @@ -68,7 +68,7 @@ namespace glm # else union {T x, r, s;}; /* -# if GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) # endif */ @@ -112,13 +112,13 @@ namespace glm // -- Swizzle constructors -- /* -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) { *this = that(); } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR */ // -- Unary arithmetic operators -- diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 72349e04..1eda653a 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -169,55 +169,51 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else + else return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# else + else return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else + else return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# endif + } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# else + else return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO) return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO) return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO) return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO) return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif } template @@ -279,55 +275,50 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else + else return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# else + else return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else + else return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# else + else return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO) return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO) return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO) return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO) return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif } template @@ -397,55 +388,51 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else + else return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# else + else return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else + else return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# endif + } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# else + else return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO) return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO) return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO) return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO) return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif } template @@ -531,55 +518,50 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else + else return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CONFIG_CLIP_CONTROL_LEFT_HANDED_BIT) return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# else + else return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CONFIG_CLIP_CONTROL_ZERO_TO_ONE_BIT) return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else + else return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CONFIG_CLIP_CONTROL_ZERO_TO_ONE_BIT) return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# else + else return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif } template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO) return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO) return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO) return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE + else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO) return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif } template @@ -621,11 +603,10 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return infinitePerspectiveLH(fovy, aspect, zNear); -# else + else return infinitePerspectiveRH(fovy, aspect, zNear); -# endif } // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf @@ -688,11 +669,10 @@ namespace glm template GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return projectZO(obj, model, proj, viewport); -# else + else return projectNO(obj, model, proj, viewport); -# endif } template @@ -731,11 +711,10 @@ namespace glm template GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT) return unProjectZO(win, model, proj, viewport); -# else + else return unProjectNO(win, model, proj, viewport); -# endif } template @@ -806,10 +785,9 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED + if(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) return lookAtLH(eye, center, up); -# else + else return lookAtRH(eye, center, up); -# endif } }//namespace glm diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 0c08d643..be87086c 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -90,10 +90,10 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0), w(1) # endif {} @@ -227,7 +227,7 @@ namespace detail // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) { @@ -819,7 +819,7 @@ namespace detail } }//namespace glm -#if GLM_USE_SIMD == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "quaternion_simd.inl" #endif diff --git a/glm/gtc/type_aligned.hpp b/glm/gtc/type_aligned.hpp index 6d9f11dd..c2b90b3a 100644 --- a/glm/gtc/type_aligned.hpp +++ b/glm/gtc/type_aligned.hpp @@ -12,7 +12,7 @@ #pragma once -#if !GLM_USE_ANONYMOUS_STRUCT +#if !GLM_CONFIG_ANONYMOUS_STRUCT # error "GLM: Aligned gentypes require to enable C++ language extensions and to define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers." #endif diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 64fe8cd5..4cf8581c 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -24,10 +24,10 @@ namespace glm // -- Implicit basic constructors -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() -# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : real(tquat()) , dual(tquat(0, 0, 0, 0)) # endif @@ -91,7 +91,7 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) { diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index e2aa5102..4aadfa8f 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -220,7 +220,7 @@ namespace glm template GLM_FUNC_QUALIFIER tquat quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT return quatLookAtLH(direction, up); # else return quatLookAtRH(direction, up); diff --git a/test/bug/bug_ms_vec_static.cpp b/test/bug/bug_ms_vec_static.cpp index ce93185d..7f44e409 100644 --- a/test/bug/bug_ms_vec_static.cpp +++ b/test/bug/bug_ms_vec_static.cpp @@ -1,6 +1,6 @@ #include -#if GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE +#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE struct vec2; struct _swizzle diff --git a/test/core/core_cpp_constexpr.cpp b/test/core/core_cpp_constexpr.cpp index 7cfb3e8f..e7d9283a 100644 --- a/test/core/core_cpp_constexpr.cpp +++ b/test/core/core_cpp_constexpr.cpp @@ -1,6 +1,6 @@ #include -#if GLM_USE_CONSTEXP == GLM_ENABLE +#if GLM_CONFIG_CONSTEXP == GLM_ENABLE #include #include @@ -663,20 +663,20 @@ static int test_mat2x2() return Error; } -#endif//GLM_USE_CONSTEXP == GLM_ENABLE +#endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE int main() { int Error = 0; -# if GLM_USE_CONSTEXP == GLM_ENABLE +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE Error += test_vec1(); Error += test_vec2(); Error += test_vec3(); Error += test_vec4(); Error += test_quat(); Error += test_mat2x2(); -# endif//GLM_USE_CONSTEXP == GLM_ENABLE +# endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE return Error; } diff --git a/test/core/core_cpp_defaulted_ctor.cpp b/test/core/core_cpp_defaulted_ctor.cpp index 91047768..a80d2eda 100644 --- a/test/core/core_cpp_defaulted_ctor.cpp +++ b/test/core/core_cpp_defaulted_ctor.cpp @@ -1,6 +1,6 @@ #include -#if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE #include #include @@ -127,17 +127,17 @@ static int test_quat_memcpy() return Error; } -#endif//GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +#endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE int main() { int Error = 0; -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE Error += test_vec_memcpy(); Error += test_mat_memcpy(); Error += test_quat_memcpy(); -# endif//GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE return Error; } diff --git a/test/core/core_force_pure.cpp b/test/core/core_force_pure.cpp index 9ca58768..bd6a11df 100644 --- a/test/core/core_force_pure.cpp +++ b/test/core/core_force_pure.cpp @@ -51,7 +51,7 @@ int test_vec4_ctor() } #endif -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); glm::ivec4 B = A.xyzw; @@ -82,7 +82,7 @@ int test_vec4_ctor() } # endif -# if GLM_SWIZZLE +# if GLM_CONFIG_SWIZZLE { glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); glm::ivec4 B = A.xyzw(); @@ -111,7 +111,7 @@ int test_vec4_ctor() Error += glm::all(glm::equal(A, L)) ? 0 : 1; Error += glm::all(glm::equal(A, M)) ? 0 : 1; } -# endif//GLM_SWIZZLE +# endif//GLM_CONFIG_SWIZZLE { glm::ivec4 A(1); @@ -343,7 +343,7 @@ int test_vec4_swizzle_partial() glm::vec4 A(1, 2, 3, 4); -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec4 B(A.xy, A.zw); Error += A == B ? 0 : 1; diff --git a/test/core/core_func_swizzle.cpp b/test/core/core_func_swizzle.cpp index aebd6b85..70272aca 100644 --- a/test/core/core_func_swizzle.cpp +++ b/test/core/core_func_swizzle.cpp @@ -6,7 +6,7 @@ static int test_ivec2_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::ivec2 A(1, 2); glm::ivec2 B = A.yx(); @@ -15,9 +15,9 @@ static int test_ivec2_swizzle() Error += A != B ? 0 : 1; Error += A == C ? 0 : 1; } -# endif//GLM_SWIZZLE +# endif//GLM_CONFIG_SWIZZLE -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec2 A(1, 2); glm::ivec2 B = A.yx; @@ -38,7 +38,7 @@ static int test_ivec2_swizzle() glm::ivec2 E = A.yx; Error += E == D ? 0 : 1; } -# endif//GLM_SWIZZLE +# endif//GLM_CONFIG_SWIZZLE return Error; } @@ -47,7 +47,7 @@ int test_ivec3_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::ivec3 A(1, 2, 3); glm::ivec3 B = A.zyx(); @@ -58,7 +58,7 @@ int test_ivec3_swizzle() } # endif -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec3 const A(1, 2, 3); glm::ivec2 B = A.yx; @@ -112,7 +112,7 @@ int test_ivec4_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::ivec4 A(1, 2, 3, 4); glm::ivec4 B = A.wzyx(); @@ -130,7 +130,7 @@ int test_vec4_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::vec4 A(1, 2, 3, 4); glm::vec4 B = A.wzyx(); diff --git a/test/core/core_type_ctor.cpp b/test/core/core_type_ctor.cpp index 64e3c242..078fcdf0 100644 --- a/test/core/core_type_ctor.cpp +++ b/test/core/core_type_ctor.cpp @@ -8,7 +8,7 @@ static int test_vec1_ctor() { int Error = 0; -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -22,7 +22,7 @@ static int test_vec1_ctor() B.f = glm::vec1(1); Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1; } -# endif//GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE return Error; } @@ -31,7 +31,7 @@ static int test_vec2_ctor() { int Error = 0; -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -54,7 +54,7 @@ static int test_vec3_ctor() { int Error = 0; -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -77,7 +77,7 @@ static int test_vec4_ctor() { int Error = 0; -# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index c20e3f13..cef71749 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -130,7 +130,7 @@ static int test_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec1 A = glm::vec1(1.0f); //glm::vec1 B = A.x; @@ -139,7 +139,7 @@ static int test_swizzle() //Error += glm::all(glm::equal(A, B)) ? 0 : 1; Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR return Error; } diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 50b0d4dd..03456861 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -349,7 +349,7 @@ static int test_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec2 A = glm::vec2(1.0f, 2.0f); glm::vec2 B = A.xy; @@ -360,9 +360,9 @@ static int test_swizzle() Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; Error += glm::all(glm::equal(A, D, 0.0001f)) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::vec2 A = glm::vec2(1.0f, 2.0f); glm::vec2 B = A.xy(); @@ -371,7 +371,7 @@ static int test_swizzle() Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION return Error; } diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 2e33ffe0..50683022 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -319,7 +319,7 @@ int test_vec3_swizzle3_2() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec3 v(1, 2, 3); glm::ivec2 u; @@ -374,7 +374,7 @@ int test_vec3_swizzle3_2() v.zy = u; Error += (v.x == 2 && v.y == 2 && v.z == 1) ? 0 : 1; //v.zz = u; //Illegal } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR return Error; } @@ -383,7 +383,7 @@ int test_vec3_swizzle3_3() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec3 v(1, 2, 3); glm::ivec3 u; @@ -414,7 +414,7 @@ int test_vec3_swizzle_operators() glm::ivec3 const u = glm::ivec3(1, 2, 3); glm::ivec3 const v = glm::ivec3(10, 20, 30); -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec3 q; @@ -453,7 +453,7 @@ int test_vec3_swizzle_functions() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { // NOTE: template functions cannot pick up the implicit conversion from // a swizzle to the unswizzled type, therefore the operator() must be @@ -487,7 +487,7 @@ int test_vec3_swizzle_functions() r = glm::dot(s.xyzw(), t.xyzw()); Error += (int(r) == 300) ? 0 : 1; r = glm::dot(s.xyz(), t.xyz()); Error += (int(r) == 140) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION return Error; } @@ -496,7 +496,7 @@ int test_vec3_swizzle_partial() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec3 const A(1, 2, 3); glm::vec3 B(A.xy, 3); @@ -514,7 +514,7 @@ int test_vec3_swizzle_partial() glm::ivec3 const B(A.xyz); Error += A == B ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR return Error; } @@ -550,7 +550,7 @@ static int test_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); glm::vec3 B = A.xyz; @@ -569,9 +569,9 @@ static int test_swizzle() Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); glm::vec3 B = A.xyz(); @@ -590,7 +590,7 @@ static int test_swizzle() Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION return Error; } diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 8d7a4c14..8558fbb3 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -486,7 +486,7 @@ static int test_swizzle_partial() glm::vec4 const A(1, 2, 3, 4); -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::vec4 B(A.xy, A.zw); Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; @@ -512,7 +512,7 @@ static int test_swizzle_partial() glm::vec4 B(1.0f, A.yzw); Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION return Error; } @@ -521,7 +521,7 @@ static int test_swizzle() { int Error = 0; -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR { glm::ivec4 A = glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f); glm::ivec4 B = A.xyzw; @@ -550,9 +550,9 @@ static int test_swizzle() Error += glm::all(glm::equal(A, L)) ? 0 : 1; Error += glm::all(glm::equal(A, M)) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION { glm::vec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); glm::vec4 B = A.xyzw(); @@ -581,7 +581,7 @@ static int test_swizzle() Error += glm::all(glm::equal(A, L, glm::epsilon())) ? 0 : 1; Error += glm::all(glm::equal(A, M, glm::epsilon())) ? 0 : 1; } -# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_SWIZZLE == GLM_SWIZZLE_FUNCTION +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION return Error; } diff --git a/test/gtc/gtc_type_aligned.cpp b/test/gtc/gtc_type_aligned.cpp index 67e5db85..e3e9dca3 100644 --- a/test/gtc/gtc_type_aligned.cpp +++ b/test/gtc/gtc_type_aligned.cpp @@ -1,7 +1,7 @@ #define GLM_FORCE_ALIGNED_GENTYPES #include -#if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE #include #include @@ -177,4 +177,4 @@ int main() return 0; } -#endif//GLM_USE_ANONYMOUS_STRUCT +#endif//GLM_CONFIG_ANONYMOUS_STRUCT diff --git a/test/gtx/gtx_io.cpp b/test/gtx/gtx_io.cpp index ad0b49b3..4ddb79e4 100644 --- a/test/gtx/gtx_io.cpp +++ b/test/gtx/gtx_io.cpp @@ -20,7 +20,7 @@ namespace case glm::highp: os << "uhi"; break; case glm::mediump: os << "umd"; break; case glm::lowp: os << "ulo"; break; -# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE case glm::aligned_highp: os << "ahi"; break; case glm::aligned_mediump: os << "amd"; break; case glm::aligned_lowp: os << "alo"; break; diff --git a/test/gtx/gtx_load.cpp b/test/gtx/gtx_load.cpp index b6ce1ccd..35f9d7e7 100644 --- a/test/gtx/gtx_load.cpp +++ b/test/gtx/gtx_load.cpp @@ -7,7 +7,7 @@ #include #include /* -#if GLM_USE_SIMD == GLM_ENABLE && GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE && GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE namespace glm { @@ -116,7 +116,7 @@ int main() { int Error = 0; /* -# if GLM_USE_SIMD == GLM_ENABLE && GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_SIMD == GLM_ENABLE && GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE Error += test_vec4_load(); # endif */