diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 3c52c10f..a2244e26 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -447,16 +447,12 @@ #define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_FUNCTION 2 -#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.") # define GLM_FORCE_SWIZZLE #endif -#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) +#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR #elif defined(GLM_FORCE_SWIZZLE) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 52ef408e..3899f8dd 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..4dff6551 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..8eca4141 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 {