Merged 0.9.8 branch

This commit is contained in:
Christophe Riccio 2017-01-07 12:15:08 +01:00
commit 39f775fa6c
18 changed files with 183 additions and 136 deletions

View file

@ -445,6 +445,11 @@
((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70))))
#endif
#define GLM_HAS_ONLY_XYZW ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER < GLM_COMPILER_GCC46))
#if GLM_HAS_ONLY_XYZW
# pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")
#endif
//
#if GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_ASSIGNABLE 1
@ -713,17 +718,21 @@
# define GLM_DEFAULT_CTOR
#endif
#if GLM_HAS_CONSTEXPR
#if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL
# define GLM_CONSTEXPR constexpr
# define GLM_CONSTEXPR_CTOR constexpr
# define GLM_RELAXED_CONSTEXPR constexpr
#elif GLM_HAS_CONSTEXPR_PARTIAL
# define GLM_CONSTEXPR constexpr
# define GLM_CONSTEXPR_CTOR
# define GLM_RELAXED_CONSTEXPR const
# if GLM_COMPILER & GLM_COMPILER_VC // Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594
# define GLM_CONSTEXPR_CTOR
# else
# define GLM_CONSTEXPR_CTOR constexpr
# endif
#else
# define GLM_CONSTEXPR
# define GLM_CONSTEXPR_CTOR
#endif
#if GLM_HAS_CONSTEXPR
# define GLM_RELAXED_CONSTEXPR constexpr
#else
# define GLM_RELAXED_CONSTEXPR const
#endif

View file

@ -27,7 +27,10 @@ namespace glm
// -- Data --
# if GLM_HAS_ALIGNED_TYPE
# if GLM_HAS_ONLY_XYZW
T x;
# elif GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
@ -82,31 +85,31 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<2, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<1, U, Q> const& v);
// -- Swizzle constructors --
/*

View file

@ -7,7 +7,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0)
# endif
@ -16,14 +16,14 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, P> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, P> const & v)
: x(v.x)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, Q> const& v)
: x(v.x)
{}
@ -34,7 +34,7 @@ namespace glm
{}
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(T scalar)
: x(scalar)
{}
@ -42,25 +42,25 @@ namespace glm
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<2, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<2, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<3, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<3, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<4, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<4, U, Q> const & v)
: x(static_cast<T>(v.x))
{}

View file

@ -26,7 +26,10 @@ namespace glm
// -- Data --
# if GLM_HAS_ALIGNED_TYPE
# if GLM_HAS_ONLY_XYZW
T x, y;
# elif GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
@ -78,42 +81,42 @@ namespace glm
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;
GLM_FUNC_DECL T& operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const;
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(T x, T y);
// -- Conversion constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A x, B y);
template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& x, vec<1, B, P> const& y);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& x, vec<1, B, P> const& y);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<2, U, Q> const& v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)

View file

@ -7,7 +7,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0)
# endif
@ -16,14 +16,14 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, T, P> const& v)
: x(v.x), y(v.y)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, T, Q> const& v)
: x(v.x), y(v.y)
{}
@ -34,12 +34,12 @@ namespace glm
{}
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(T scalar)
: x(scalar), y(scalar)
{}
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T _x, T _y)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(T _x, T _y)
: x(_x), y(_y)
{}
@ -47,14 +47,14 @@ namespace glm
template<typename T, precision P>
template<typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A _x, B _y)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(A _x, B _y)
: x(static_cast<T>(_x))
, y(static_cast<T>(_y))
{}
template<typename T, precision P>
template<typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y)
: x(static_cast<T>(_x.x))
, y(static_cast<T>(_y.x))
{}
@ -63,21 +63,21 @@ namespace glm
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, U, Q> const& v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<3, U, Q> const& v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<4, U, Q> const& v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}

View file

@ -26,7 +26,10 @@ namespace glm
// -- Data --
# if GLM_HAS_ALIGNED_TYPE
# if GLM_HAS_ONLY_XYZW
T x, y, z;
# elif GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
@ -83,46 +86,46 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const & v) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, Q> const & v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(T a, T b, T c);
// -- Conversion scalar constructors --
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename X, typename Y, typename Z>
GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(X x, Y y, Z z);
template<typename X, typename Y, typename Z>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, B _z);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, Q> const& _xy, B _z);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, Q> const& _yz);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<2, B, Q> const& _yz);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)

View file

@ -7,7 +7,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0)
# endif
@ -16,14 +16,14 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, P> const & v)
: x(v.x), y(v.y), z(v.z)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, Q> const & v)
: x(v.x), y(v.y), z(v.z)
{}
@ -34,12 +34,12 @@ namespace glm
{}
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(T scalar)
: x(scalar), y(scalar), z(scalar)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T _x, T _y, T _z)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(T _x, T _y, T _z)
: x(_x), y(_y), z(_z)
{}
@ -47,7 +47,7 @@ namespace glm
template<typename T, precision P>
template<typename X, typename Y, typename Z>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(X _x, Y _y, Z _z)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(X _x, Y _y, Z _z)
: x(static_cast<T>(_x))
, y(static_cast<T>(_y))
, z(static_cast<T>(_z))
@ -55,7 +55,7 @@ namespace glm
template<typename T, precision P>
template<typename X, typename Y, typename Z>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z)
: x(static_cast<T>(_x))
, y(static_cast<T>(_y))
, z(static_cast<T>(_z))
@ -65,7 +65,7 @@ namespace glm
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, B _z)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, B _z)
: x(static_cast<T>(_xy.x))
, y(static_cast<T>(_xy.y))
, z(static_cast<T>(_z))
@ -73,7 +73,7 @@ namespace glm
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z)
: x(static_cast<T>(_xy.x))
, y(static_cast<T>(_xy.y))
, z(static_cast<T>(_z.x))
@ -81,7 +81,7 @@ namespace glm
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A _x, vec<2, B, Q> const& _yz)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(A _x, vec<2, B, Q> const& _yz)
: x(static_cast<T>(_x))
, y(static_cast<T>(_yz.x))
, z(static_cast<T>(_yz.y))
@ -89,7 +89,7 @@ namespace glm
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz)
: x(static_cast<T>(_x.x))
, y(static_cast<T>(_yz.x))
, z(static_cast<T>(_yz.y))
@ -97,7 +97,7 @@ namespace glm
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, U, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, U, Q> const& v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
, z(static_cast<T>(v.z))
@ -105,7 +105,7 @@ namespace glm
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<4, U, Q> const& v) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<4, U, Q> const& v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)),
z(static_cast<T>(v.z))

View file

@ -26,7 +26,10 @@ namespace glm
// -- Data --
# if GLM_HAS_ALIGNED_TYPE
# if GLM_HAS_ONLY_XYZW
T x, y, z, w;
# elif GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
@ -109,41 +112,41 @@ namespace glm
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, B _z, C _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, Q> const& _xy, B _z, C _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, Q> const& _yz, C _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<2, B, Q> const& _yz, C _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, Q> const& _zw);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, B _y, vec<2, C, Q> const& _zw);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const& _xyz, B _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, A, Q> const& _xyz, B _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, Q> const& _yzw);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<3, B, Q> const& _yzw);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
@ -192,34 +195,34 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, T, P> const & v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(U scalar);
GLM_FUNC_DECL vec<4, T, P>& operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(U scalar);
GLM_FUNC_DECL vec<4, T, P>& operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(U scalar);
GLM_FUNC_DECL vec<4, T, P>& operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<1, U, P> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<4, U, P> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(U scalar);
GLM_FUNC_DECL vec<4, T, P>& operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<4, U, P> const & v);
// -- Increment and decrement operators --

View file

@ -216,7 +216,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, B _z, C _w)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, B _z, C _w)
: x(static_cast<T>(_xy.x))
, y(static_cast<T>(_xy.y))
, z(static_cast<T>(_z))
@ -225,7 +225,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w)
: x(static_cast<T>(_xy.x))
, y(static_cast<T>(_xy.y))
, z(static_cast<T>(_z.x))
@ -234,7 +234,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(A _x, vec<2, B, Q> const& _yz, C _w)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, vec<2, B, Q> const& _yz, C _w)
: x(static_cast<T>(_x))
, y(static_cast<T>(_yz.x))
, z(static_cast<T>(_yz.y))
@ -243,7 +243,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w)
: x(static_cast<T>(_x.x))
, y(static_cast<T>(_yz.x))
, z(static_cast<T>(_yz.y))
@ -252,7 +252,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(A _x, B _y, vec<2, C, Q> const& _zw)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, B _y, vec<2, C, Q> const& _zw)
: x(static_cast<T>(_x))
, y(static_cast<T>(_y))
, z(static_cast<T>(_zw.x))
@ -261,7 +261,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw)
: x(static_cast<T>(_x.x))
, y(static_cast<T>(_y.x))
, z(static_cast<T>(_zw.x))
@ -270,7 +270,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, B _w) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, B _w) :
x(static_cast<T>(_xyz.x)),
y(static_cast<T>(_xyz.y)),
z(static_cast<T>(_xyz.z)),
@ -279,7 +279,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w) :
x(static_cast<T>(_xyz.x)),
y(static_cast<T>(_xyz.y)),
z(static_cast<T>(_xyz.z)),
@ -288,7 +288,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(A _x, vec<3, B, Q> const& _yzw) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, vec<3, B, Q> const& _yzw) :
x(static_cast<T>(_x)),
y(static_cast<T>(_yzw.x)),
z(static_cast<T>(_yzw.y)),
@ -297,7 +297,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw) :
x(static_cast<T>(_x.x)),
y(static_cast<T>(_yzw.x)),
z(static_cast<T>(_yzw.y)),
@ -306,7 +306,7 @@ namespace detail
template<typename T, precision P>
template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw) :
x(static_cast<T>(_xy.x)),
y(static_cast<T>(_xy.y)),
z(static_cast<T>(_zw.x)),
@ -315,7 +315,7 @@ namespace detail
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<4, U, Q> const& v) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<4, U, Q> const& v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)),
z(static_cast<T>(v.z)),

View file

@ -23,7 +23,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorRGB, T GammaCorrection)
{
return vec<4, T, P>(compute_rgbToSrgb<3, T, P, vec>::call(vec<3, T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
return vec<4, T, P>(compute_rgbToSrgb<3, T, P, vec>::call(vec<3, T, P>(ColorRGB), GammaCorrection), ColorRGB.w);
}
};
@ -44,7 +44,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorSRGB, T Gamma)
{
return vec<4, T, P>(compute_srgbToRgb<3, T, P, vec>::call(vec<3, T, P>(ColorSRGB), Gamma), ColorSRGB.a);
return vec<4, T, P>(compute_srgbToRgb<3, T, P, vec>::call(vec<3, T, P>(ColorSRGB), Gamma), ColorSRGB.w);
}
};
}//namespace detail

View file

@ -105,20 +105,19 @@ namespace glm
{
vec<3, T, defaultp> rgbw = vec<3, T, defaultp>(T(0.2126), T(0.7152), T(0.0722));
T col0 = (T(1) - s) * rgbw.r;
T col1 = (T(1) - s) * rgbw.g;
T col2 = (T(1) - s) * rgbw.b;
vec<3, T, defaultp> const col((T(1) - s) * rgbw);
mat<4, 4, T, defaultp> result(T(1));
result[0][0] = col0 + s;
result[0][1] = col0;
result[0][2] = col0;
result[1][0] = col1;
result[1][1] = col1 + s;
result[1][2] = col1;
result[2][0] = col2;
result[2][1] = col2;
result[2][2] = col2 + s;
result[0][0] = col.x + s;
result[0][1] = col.x;
result[0][2] = col.x;
result[1][0] = col.y;
result[1][1] = col.y + s;
result[1][2] = col.y;
result[2][0] = col.z;
result[2][1] = col.z;
result[2][2] = col.z + s;
return result;
}

View file

@ -93,6 +93,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Fixed intersectRayPlane returns true in parallel case #578
- Fixed GCC 6.2 compiler warnings #580
- Fixed GTX_matrix_decompose decompose #582 #448
- Fixed GCC 4.5 and older build #566
- Fixed Visual C++ internal error when declaring a global vec type with siwzzle expression enabled #594
---
### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12

View file

@ -19,7 +19,7 @@ struct vec2
};
// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler.
vec2 Bar;
// vec2 Bar;
int main()
{

View file

@ -2,6 +2,8 @@
#define GLM_FORCE_SWIZZLE
#include <glm/glm.hpp>
#if !GLM_HAS_ONLY_XYZW
int test_ivec2_swizzle()
{
int Error = 0;
@ -60,16 +62,19 @@ int test_vec4_swizzle()
return Error;
}
#endif//!GLM_HAS_ONLY_XYZW
int main()
{
int Error = 0;
Error += test_ivec2_swizzle();
Error += test_ivec3_swizzle();
Error += test_ivec4_swizzle();
# if !GLM_HAS_ONLY_XYZW
Error += test_ivec2_swizzle();
Error += test_ivec3_swizzle();
Error += test_ivec4_swizzle();
Error += test_vec4_swizzle();
Error += test_vec4_swizzle();
# endif//!GLM_HAS_ONLY_XYZW
return Error;
}

View file

@ -3,6 +3,9 @@
#include <glm/gtc/vec1.hpp>
#include <vector>
static glm::vec1 v1;
static glm::vec1 v2(1);
int test_vec1_operators()
{
int Error(0);

View file

@ -6,6 +6,10 @@
# include <type_traits>
#endif
static glm::vec2 v1;
static glm::vec2 v2(1);
static glm::vec2 v3(1, 1);
int test_vec2_operators()
{
int Error = 0;

View file

@ -7,6 +7,10 @@
#include <cstdio>
#include <vector>
static glm::vec3 v1;
static glm::vec3 v2(1);
static glm::vec3 v3(1, 1, 1);
int test_vec3_ctor()
{
int Error = 0;
@ -334,6 +338,7 @@ int test_vec3_swizzle3_3()
return Error;
}
#if !GLM_HAS_ONLY_XYZW
int test_vec3_swizzle_operators()
{
int Error = 0;
@ -440,6 +445,7 @@ int test_vec3_swizzle_partial()
return Error;
}
#endif//!GLM_HAS_ONLY_XYZW
int test_operator_increment()
{
@ -480,10 +486,13 @@ int main()
Error += test_vec3_size();
Error += test_vec3_swizzle3_2();
Error += test_vec3_swizzle3_3();
Error += test_vec3_swizzle_partial();
Error += test_vec3_swizzle_operators();
Error += test_vec3_swizzle_functions();
Error += test_operator_increment();
# if !GLM_HAS_ONLY_XYZW
Error += test_vec3_swizzle_partial();
Error += test_vec3_swizzle_operators();
Error += test_vec3_swizzle_functions();
# endif//!GLM_HAS_ONLY_XYZW
return Error;
}

View file

@ -8,7 +8,11 @@
#include <ctime>
#include <vector>
template<int Value>
static glm::vec4 v1;
static glm::vec4 v2(1);
static glm::vec4 v3(1, 1, 1, 1);
template <int Value>
struct mask
{
enum{value = Value};