Refactor configuration macros

This commit is contained in:
Groove 2018-07-31 23:05:48 +02:00
parent 3b938d55b9
commit fbf3f2016f
50 changed files with 323 additions and 333 deletions

View File

@ -16,7 +16,7 @@ namespace detail
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed || GLM_UNRESTRICTED_GENTYPE,
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::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<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer) || GLM_UNRESTRICTED_GENTYPE,
(!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer) || GLM_CONFIG_UNRESTRICTED_GENTYPE,
"'abs' only accept floating-point and integer scalar or vector inputs");
return x;
}

View File

@ -15,7 +15,7 @@ namespace glm
template<typename genType>
GLM_FUNC_QUALIFIER genType min(genType x, genType y)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::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<typename genType>
GLM_FUNC_QUALIFIER genType max(genType x, genType y)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::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<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a)
{
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vec<L, T, Q>(vec<L, U, Q>(x) + a * vec<L, U, Q>(y - x));
}
@ -104,7 +104,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U const& a)
{
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vec<L, T, Q>(vec<L, U, Q>(x) + a * vec<L, U, Q>(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<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
}
@ -258,7 +258,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
vec<L, T, Q> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
}
@ -474,7 +474,7 @@ namespace detail
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> min(vec<L, T, Q> const& a, T b)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
return detail::compute_min_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
}
@ -488,7 +488,7 @@ namespace detail
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> max(vec<L, T, Q> const& a, T b)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
return detail::compute_max_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
}
@ -502,21 +502,21 @@ namespace detail
template<typename genType>
GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return min(max(x, minVal), maxVal);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, vec<L, T, Q>(minVal), vec<L, T, Q>(maxVal));
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, minVal, maxVal);
}
@ -561,7 +561,7 @@ namespace detail
template<typename genType>
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::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<typename genType>
GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
return std::frexp(x, &exp);
}
@ -753,7 +753,7 @@ namespace detail
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> frexp(vec<L, T, Q> const& v, vec<L, int, Q>& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
vec<L, T, Q> Result;
for (length_t l = 0; l < v.length(); ++l)
@ -764,7 +764,7 @@ namespace detail
template<typename genType>
GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
return std::ldexp(x, exp);
}
@ -772,7 +772,7 @@ namespace detail
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> ldexp(vec<L, T, Q> const& v, vec<L, int, Q> const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
vec<L, T, Q> 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

View File

@ -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

View File

@ -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>
{

View File

@ -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

View File

@ -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

View File

@ -358,14 +358,14 @@ namespace detail
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<C, R, T, Q> matrixCompMult(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs");
return detail::compute_matrixCompMult<C, R, T, Q, detail::is_aligned<Q>::value>::call(x, y);
}
template<length_t DA, length_t DB, typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, Q>::type outerProduct(vec<DA, T, Q> const& c, vec<DB, T, Q> const& r)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
typename detail::outerProduct_trait<DA, DB, T, Q>::type m;
for(length_t i = 0; i < m.length(); ++i)
@ -376,26 +376,26 @@ namespace detail
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<C, R, T, Q>::transpose_type transpose(mat<C, R, T, Q> const& m)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs");
return detail::compute_transpose<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T determinant(mat<C, R, T, Q> const& m)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs");
return detail::compute_determinant<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<C, R, T, Q> inverse(mat<C, R, T, Q> const& m)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
return detail::compute_inverse<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
}//namespace glm
#if GLM_USE_SIMD == GLM_ENABLE
#if GLM_CONFIG_SIMD == GLM_ENABLE
# include "func_matrix_simd.inl"
#endif

View File

@ -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)
{

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<glm::aligned_lowp>
{

View File

@ -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_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.")

View File

@ -7,14 +7,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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);

View File

@ -7,14 +7,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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);

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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);

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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);

View File

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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);

View File

@ -7,14 +7,14 @@ namespace glm
{
// -- Constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::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<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::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

View File

@ -5,10 +5,10 @@ namespace glm
{
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v)
{

View File

@ -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 <cstddef>
@ -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<Q>::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<int E0, int E1>
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 --

View File

@ -7,10 +7,10 @@ namespace glm
{
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v)
{

View File

@ -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 <cstddef>
@ -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<Q>::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<int E0, int E1, int E2>
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 --

View File

@ -5,10 +5,10 @@ namespace glm
{
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v)
{

View File

@ -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 <cstddef>
@ -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<Q>::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<int E0, int E1, int E2, int E3>
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 --

View File

@ -158,10 +158,10 @@ namespace detail
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
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<typename T, qualifier Q>
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

View File

@ -6,7 +6,7 @@
namespace glm{
namespace detail
{
# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
template<qualifier Q, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
{
@ -49,7 +49,7 @@ namespace detail
return Result;
}
};
# endif// GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
template<qualifier Q>
struct compute_vec4_add<float, Q, true>
@ -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<float, aligned_lowp, true>
{
@ -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

View File

@ -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

View File

@ -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 <cstddef>
@ -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<Q>::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<int E0>
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 --

View File

@ -169,55 +169,51 @@ namespace glm
template<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
@ -279,55 +275,50 @@ namespace glm
template<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
@ -397,55 +388,51 @@ namespace glm
template<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
@ -531,55 +518,50 @@ namespace glm
template<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
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<typename T>
@ -621,11 +603,10 @@ namespace glm
template<typename T>
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<typename T, typename U, qualifier Q>
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<typename T, typename U, qualifier Q>
@ -731,11 +711,10 @@ namespace glm
template<typename T, typename U, qualifier Q>
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<typename T, qualifier Q, typename U>
@ -806,10 +785,9 @@ namespace glm
template<typename T, qualifier Q>
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

View File

@ -90,10 +90,10 @@ namespace detail
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::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<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator=(tquat<T, Q> 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

View File

@ -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

View File

@ -24,10 +24,10 @@ namespace glm
// -- Implicit basic constructors --
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, Q>::tdualquat()
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
: real(tquat<T, Q>())
, dual(tquat<T, Q>(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<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tdualquat<T, Q> & tdualquat<T, Q>::operator=(tdualquat<T, Q> const& q)
{

View File

@ -220,7 +220,7 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> 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);

View File

@ -1,6 +1,6 @@
#include <glm/glm.hpp>
#if GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE
#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
struct vec2;
struct _swizzle

View File

@ -1,6 +1,6 @@
#include <glm/glm.hpp>
#if GLM_USE_CONSTEXP == GLM_ENABLE
#if GLM_CONFIG_CONSTEXP == GLM_ENABLE
#include <glm/gtc/constants.hpp>
#include <glm/gtc/quaternion.hpp>
@ -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;
}

View File

@ -1,6 +1,6 @@
#include <glm/glm.hpp>
#if GLM_USE_DEFAULTED_FUNCTIONS == GLM_ENABLE
#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
#include <glm/gtc/constants.hpp>
#include <glm/gtc/quaternion.hpp>
@ -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;
}

View File

@ -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;

View File

@ -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();

View File

@ -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
{

View File

@ -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<float>())) ? 0 : 1;
}
# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
return Error;
}

View File

@ -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;
}

View File

@ -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<float>())) ? 0 : 1;
Error += glm::all(glm::equal(A, H, glm::epsilon<float>())) ? 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<float>())) ? 0 : 1;
Error += glm::all(glm::equal(A, H, glm::epsilon<float>())) ? 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;
}

View File

@ -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<float>())) ? 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<float>())) ? 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<float>())) ? 0 : 1;
Error += glm::all(glm::equal(A, M, glm::epsilon<float>())) ? 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;
}

View File

@ -1,7 +1,7 @@
#define GLM_FORCE_ALIGNED_GENTYPES
#include <glm/glm.hpp>
#if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
#include <glm/gtc/type_aligned.hpp>
#include <glm/ext/vector_relational.hpp>
@ -177,4 +177,4 @@ int main()
return 0;
}
#endif//GLM_USE_ANONYMOUS_STRUCT
#endif//GLM_CONFIG_ANONYMOUS_STRUCT

View File

@ -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;

View File

@ -7,7 +7,7 @@
#include <glm/ext/vector_relational.hpp>
#include <glm/glm.hpp>
/*
#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
*/