From 3b3db0fc5a22c39733800d1f544d798e177c957b Mon Sep 17 00:00:00 2001 From: Arthur Danskin Date: Mon, 29 Jun 2020 01:54:26 -0400 Subject: [PATCH] make GLM_CONFIG_XYZW_ONLY work with GLM_SWIZZLE_FUNCTION --- glm/detail/setup.hpp | 6 +++--- glm/detail/type_vec2.hpp | 3 +++ glm/detail/type_vec3.hpp | 3 +++ glm/detail/type_vec4.hpp | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 130eed54..c9c89a57 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -447,9 +447,9 @@ #define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_FUNCTION 2 -#if defined(GLM_FORCE_XYZW_ONLY) -# undef GLM_FORCE_SWIZZLE -#endif +//#if defined(GLM_FORCE_XYZW_ONLY) +//# undef GLM_FORCE_SWIZZLE +//#endif #if defined(GLM_SWIZZLE) # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 52ef408e..8e891552 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -40,6 +40,9 @@ namespace glm # if GLM_CONFIG_XYZW_ONLY T x, y; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, Q, x, y) +# endif//GLM_CONFIG_SWIZZLE # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index d83cde67..b5c700c0 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -43,6 +43,9 @@ namespace glm # if GLM_CONFIG_XYZW_ONLY T x, y, z; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, Q, x, y, z) +# endif//GLM_CONFIG_SWIZZLE # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 4a364346..5a386f42 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -40,6 +40,9 @@ namespace glm # if GLM_CONFIG_XYZW_ONLY T x, y, z, w; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, Q, x, y, z, w) +# endif//GLM_CONFIG_SWIZZLE # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union {