From 007ee48b5801926cfcbd05d0c6f4ce0c0453cefd Mon Sep 17 00:00:00 2001 From: duarm Date: Sun, 15 Jan 2023 20:47:40 -0300 Subject: [PATCH] adding initialization macros for ivec types --- include/cglm/ivec2.h | 14 +++++++++++++- include/cglm/ivec3.h | 14 +++++++++++++- include/cglm/ivec4.h | 14 +++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/include/cglm/ivec2.h b/include/cglm/ivec2.h index d6c7484..7f27132 100644 --- a/include/cglm/ivec2.h +++ b/include/cglm/ivec2.h @@ -6,7 +6,13 @@ */ /* -FUNCTIONS: + Macros: + GLM_IVEC2_ONE_INIT + GLM_IVEC2_ZERO_INIT + GLM_IVEC2_ONE + GLM_IVEC2_ZERO + + Functions: CGLM_INLINE void glm_ivec2(int * __restrict v, ivec2 dest) CGLM_INLINE void glm_ivec2_copy(ivec2 a, ivec2 dest) CGLM_INLINE void glm_ivec2_zero(ivec2 v) @@ -30,6 +36,12 @@ FUNCTIONS: #include "common.h" +#define GLM_IVEC2_ONE_INIT {1, 1} +#define GLM_IVEC2_ZERO_INIT {0, 0} + +#define GLM_IVEC2_ONE ((ivec2)GLM_IVEC2_ONE_INIT) +#define GLM_IVEC2_ZERO ((ivec2)GLM_IVEC2_ZERO_INIT) + /*! * @brief init ivec2 using vec3 or vec4 * diff --git a/include/cglm/ivec3.h b/include/cglm/ivec3.h index 0dfb57a..a255d8d 100644 --- a/include/cglm/ivec3.h +++ b/include/cglm/ivec3.h @@ -6,7 +6,13 @@ */ /* -FUNCTIONS: + Macros: + GLM_IVEC3_ONE_INIT + GLM_IVEC3_ZERO_INIT + GLM_IVEC3_ONE + GLM_IVEC3_ZERO + + Functions: CGLM_INLINE void glm_ivec3(ivec4 v4, ivec3 dest) CGLM_INLINE void glm_ivec3_copy(ivec3 a, ivec3 dest) CGLM_INLINE void glm_ivec3_zero(ivec3 v) @@ -30,6 +36,12 @@ FUNCTIONS: #include "common.h" +#define GLM_IVEC3_ONE_INIT {1, 1, 1} +#define GLM_IVEC3_ZERO_INIT {0, 0, 0} + +#define GLM_IVEC3_ONE ((ivec3)GLM_IVEC3_ONE_INIT) +#define GLM_IVEC3_ZERO ((ivec3)GLM_IVEC3_ZERO_INIT) + /*! * @brief init ivec3 using ivec4 * diff --git a/include/cglm/ivec4.h b/include/cglm/ivec4.h index 6706036..6881f0a 100644 --- a/include/cglm/ivec4.h +++ b/include/cglm/ivec4.h @@ -6,7 +6,13 @@ */ /* -FUNCTIONS: + Macros: + GLM_IVEC4_ONE_INIT + GLM_IVEC4_ZERO_INIT + GLM_IVEC4_ONE + GLM_IVEC4_ZERO + + Functions: CGLM_INLINE void glm_ivec4(ivec3 v3, int last, ivec4 dest) CGLM_INLINE void glm_ivec4_copy(ivec4 a, ivec4 dest) CGLM_INLINE void glm_ivec4_zero(ivec4 v) @@ -30,6 +36,12 @@ FUNCTIONS: #include "common.h" +#define GLM_IVEC4_ONE_INIT {1, 1, 1, 1} +#define GLM_IVEC4_ZERO_INIT {0, 0, 0, 0} + +#define GLM_IVEC4_ONE ((ivec4)GLM_IVEC4_ONE_INIT) +#define GLM_IVEC4_ZERO ((ivec4)GLM_IVEC4_ZERO_INIT) + /*! * @brief init ivec4 using ivec3 *