Skip to content

Commit

Permalink
Merge pull request #274 from duarm/master
Browse files Browse the repository at this point in the history
Adding initialization macros for ivec types
  • Loading branch information
recp authored Jan 17, 2023
2 parents 3877159 + e70571e commit 7f1c062
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/source/ivec2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Header: cglm/ivec2.h
Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Macros:

1. GLM_IVEC2_ONE_INIT
#. GLM_IVEC2_ZERO_INIT
#. GLM_IVEC2_ONE
#. GLM_IVEC2_ZERO

Functions:

1. :c:func:`glm_ivec2`
Expand Down
7 changes: 7 additions & 0 deletions docs/source/ivec3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Header: cglm/ivec3.h
Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Macros:

1. GLM_IVEC3_ONE_INIT
#. GLM_IVEC3_ZERO_INIT
#. GLM_IVEC3_ONE
#. GLM_IVEC3_ZERO

Functions:

1. :c:func:`glm_ivec3`
Expand Down
7 changes: 7 additions & 0 deletions docs/source/ivec4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Header: cglm/ivec4.h
Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Macros:

1. GLM_IVEC4_ONE_INIT
#. GLM_IVEC4_ZERO_INIT
#. GLM_IVEC4_ONE
#. GLM_IVEC4_ZERO

Functions:

1. :c:func:`glm_ivec4`
Expand Down
8 changes: 4 additions & 4 deletions docs/source/vec2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Table of contents (click to go):

Macros:

1. GLM_vec2_ONE_INIT
#. GLM_vec2_ZERO_INIT
#. GLM_vec2_ONE
#. GLM_vec2_ZERO
1. GLM_VEC2_ONE_INIT
#. GLM_VEC2_ZERO_INIT
#. GLM_VEC2_ONE
#. GLM_VEC2_ZERO

Functions:

Expand Down
14 changes: 13 additions & 1 deletion include/cglm/ivec2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -30,6 +36,12 @@

#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
*
Expand Down
14 changes: 13 additions & 1 deletion include/cglm/ivec3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -30,6 +36,12 @@

#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
*
Expand Down
14 changes: 13 additions & 1 deletion include/cglm/ivec4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -30,6 +36,12 @@

#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
*
Expand Down

0 comments on commit 7f1c062

Please sign in to comment.