From 4b9b7aeb20e89c5ff9e34a35fa4c6dcbe31783a9 Mon Sep 17 00:00:00 2001 From: Carsten Hartenfels Date: Sun, 11 Aug 2019 12:01:58 +0200 Subject: [PATCH] Add a vec2s struct type for consistency There's a vec2 type, so there should probably be a struct version of it too. Even if no functions use it right now, if a library user (like me) needs a 2-element vector, they don't need to roll their own. --- include/cglm/types-struct.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/cglm/types-struct.h b/include/cglm/types-struct.h index 4901f01..f064a43 100644 --- a/include/cglm/types-struct.h +++ b/include/cglm/types-struct.h @@ -10,6 +10,16 @@ #include "types.h" +typedef union vec2s { +#ifndef CGLM_NO_ANONYMOUS_STRUCT + struct { + float x; + float y; + }; +#endif + vec2 raw; +} vec2s; + typedef union vec3s { #ifndef CGLM_NO_ANONYMOUS_STRUCT struct {