Fixed condition to enable half vector specialization

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent 146eacb067
commit 66a8720bc0
  1. 2
      glm/core/setup.hpp
  2. 4
      glm/gtc/half_float.hpp
  3. 4
      glm/gtc/half_float.inl
  4. 5
      test/core/core_func_swizzle.cpp

@ -442,7 +442,7 @@
(((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || ((GLM_LANG & GLM_LANG_CXXMS) == GLM_LANG_CXXMS) || ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_LANG == GLM_LANG_CXX0X)))
#define GLM_SUPPORT_SWIZZLE_OPERATOR() \
(defined(GLM_SWIZZLE) && GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
(/*defined(GLM_SWIZZLE) && */GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
#define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)

@ -47,7 +47,7 @@
namespace glm{
namespace detail
{
#if(!GLM_SUPPORT_SWIZZLE_OPERATOR())
#if(!GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
template <>
struct tvec2<thalf>
{
@ -345,7 +345,7 @@ namespace detail
tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W);
};
#endif//(!GLM_SUPPORT_SWIZZLE_OPERATOR())
#endif//(!GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
}
//namespace detail

@ -29,7 +29,7 @@
namespace glm{
namespace detail
{
#if(!GLM_SUPPORT_SWIZZLE_OPERATOR())
#if(!GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
//////////////////////////////////////
// hvec2
@ -1003,7 +1003,7 @@ namespace detail
(*this)[w]);
}
#endif//(!GLM_SUPPORT_SWIZZLE_OPERATOR())
#endif//(!GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
}//namespace detail
}//namespace glm

@ -11,7 +11,7 @@
//#define GLM_FORCE_PURE
#define GLM_MESSAGES
#define GLM_SWIZZLE
//#define GLM_FORCE_CXX98
#define GLM_FORCE_CXX98
#include <glm/glm.hpp>
int test_vec2_swizzle()
@ -24,6 +24,7 @@ int test_vec2_swizzle()
C.xy() = B.xy();
Error += A == B ? 0 : 1;
Error += A == C ? 0 : 1;
return Error;
}
@ -38,6 +39,7 @@ int test_vec3_swizzle()
C.xyz() = B.xyz();
Error += A == B ? 0 : 1;
Error += A == C ? 0 : 1;
return Error;
}
@ -52,6 +54,7 @@ int test_vec4_swizzle()
C.xyzw() = B.xyzw();
Error += A == B ? 0 : 1;
Error += A == C ? 0 : 1;
return Error;
}

Loading…
Cancel
Save