From e789186889d48bda9cde73efb40ee6d7145b8b6b Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Tue, 25 Apr 2017 23:22:29 +0300 Subject: [PATCH] zero initializer for matrix --- include/cglm-mat.h | 6 ++++++ include/cglm-mat3.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/cglm-mat.h b/include/cglm-mat.h index e80b0ef..b3d1566 100644 --- a/include/cglm-mat.h +++ b/include/cglm-mat.h @@ -24,8 +24,14 @@ {0.0f, 0.0f, 1.0f, 0.0f}, \ {0.0f, 0.0f, 0.0f, 1.0f}} +#define GLM_MAT4_ZERO_INIT {{0.0f, 0.0f, 0.0f, 0.0f}, \ + {0.0f, 0.0f, 0.0f, 0.0f}, \ + {0.0f, 0.0f, 0.0f, 0.0f}, \ + {0.0f, 0.0f, 0.0f, 0.0f}} + /* for C only */ #define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT +#define GLM_MAT4_ZERO (mat4)GLM_MAT4_ZERO_INIT /*! * @brief copy all members of [mat] to [dest] diff --git a/include/cglm-mat3.h b/include/cglm-mat3.h index 067a0f4..915bde0 100644 --- a/include/cglm-mat3.h +++ b/include/cglm-mat3.h @@ -14,9 +14,14 @@ #define GLM_MAT3_IDENTITY_INIT {{1.0f, 0.0f, 0.0f}, \ {0.0f, 1.0f, 0.0f}, \ {0.0f, 0.0f, 1.0f}} +#define GLM_MAT3_ZERO_INIT {{0.0f, 0.0f, 0.0f}, \ + {0.0f, 0.0f, 0.0f}, \ + {0.0f, 0.0f, 0.0f}} + /* for C only */ #define GLM_MAT3_IDENTITY (mat3)GLM_MAT3_IDENTITY_INIT +#define GLM_MAT3_ZERO (mat3)GLM_MAT3_ZERO_INIT /*! * @brief copy all members of [mat] to [dest]