diff --git a/include/cglm/types-struct.h b/include/cglm/types-struct.h index f211e0a..eec8d8e 100644 --- a/include/cglm/types-struct.h +++ b/include/cglm/types-struct.h @@ -61,6 +61,16 @@ typedef union vec3s { #endif } vec3s; +typedef union ivec2s { + ivec2 raw; +#if CGLM_USE_ANONYMOUS_STRUCT + struct { + int x; + int y; + }; +#endif +} ivec2s; + typedef union ivec3s { ivec3 raw; #if CGLM_USE_ANONYMOUS_STRUCT @@ -72,6 +82,18 @@ typedef union ivec3s { #endif } ivec3s; +typedef union ivec4s { + ivec4 raw; +#if CGLM_USE_ANONYMOUS_STRUCT + struct { + int x; + int y; + int z; + int w; + }; +#endif +} ivec4s; + typedef union CGLM_ALIGN_IF(16) vec4s { vec4 raw; #if CGLM_USE_ANONYMOUS_STRUCT diff --git a/include/cglm/types.h b/include/cglm/types.h index 80463a2..a671c5a 100644 --- a/include/cglm/types.h +++ b/include/cglm/types.h @@ -42,9 +42,12 @@ #define CGLM_CASTPTR_ASSUME_ALIGNED(expr, type) \ ((type*)CGLM_ASSUME_ALIGNED((expr), __alignof__(type))) +typedef int ivec2[2]; +typedef int ivec3[3]; +typedef int ivec4[4]; + typedef float vec2[2]; typedef float vec3[3]; -typedef int ivec3[3]; typedef CGLM_ALIGN_IF(16) float vec4[4]; typedef vec4 versor; /* |x, y, z, w| -> w is the last */ typedef vec3 mat3[3];