Skip to content

Instantly share code, notes, and snippets.

@kioba
Created November 17, 2015 23:02
Show Gist options
  • Save kioba/0c45259cff86dad23fff to your computer and use it in GitHub Desktop.
Save kioba/0c45259cff86dad23fff to your computer and use it in GitHub Desktop.
GLM::vec4 union names
# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
value_type x, y, z, w;
# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT)
union
{
struct{value_type x, y, z, w;};
struct{value_type r, g, b, a;};
struct{value_type s, t, p, q;};
};
# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES)
union {value_type x, r, s;};
union {value_type y, g, t;};
union {value_type z, b, p;};
union {value_type w, a, q;};
# endif//GLM_COMPONENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment