struct: fix glms_perspective_resize

since struct param is copy-by-value, result was noop
This commit is contained in:
Recep Aslantas
2021-05-30 13:06:49 +03:00
parent 0e794f8f8f
commit 94381d3067
5 changed files with 45 additions and 13 deletions

View File

@@ -127,13 +127,20 @@ glms_perspective_default_lh_no(float aspect) {
* reized with a left-hand coordinate system and a
* clip-space of [-1, 1].
*
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
* like glm_perspective_resize_lh_no(proj.raw, aspect) to avoid create new mat4
* each time
*
* @param[in, out] proj perspective projection matrix
* @param[in] aspect aspect ratio ( width / height )
*/
CGLM_INLINE
void
mat4s
glms_perspective_resize_lh_no(mat4s proj, float aspect) {
glm_perspective_resize_lh_no(aspect, proj.raw);
mat4s dest;
dest = proj;
glm_perspective_resize_lh_no(aspect, dest.raw);
return dest;
}
/*!

View File

@@ -127,13 +127,20 @@ glms_perspective_default_lh_zo(float aspect) {
* reized with a left-hand coordinate system and a
* clip-space of [0, 1].
*
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
* like glms_perspective_resize_lh_zo(proj.raw, aspect) to avoid create new mat4
* each time
*
* @param[in, out] proj perspective projection matrix
* @param[in] aspect aspect ratio ( width / height )
*/
CGLM_INLINE
void
mat4s
glms_perspective_resize_lh_zo(mat4s proj, float aspect) {
glm_perspective_resize_lh_zo(aspect, proj.raw);
mat4s dest;
dest = proj;
glm_perspective_resize_lh_zo(aspect, dest.raw);
return dest;
}
/*!

View File

@@ -127,13 +127,20 @@ glms_perspective_default_rh_no(float aspect) {
* reized with a right-hand coordinate system and a
* clip-space of [-1, 1].
*
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
* like glm_perspective_resize_rh_no(proj.raw, aspect) to avoid create new mat4
* each time
*
* @param[in, out] proj perspective projection matrix
* @param[in] aspect aspect ratio ( width / height )
*/
CGLM_INLINE
void
mat4s
glms_perspective_resize_rh_no(mat4s proj, float aspect) {
glm_perspective_resize_rh_no(aspect, proj.raw);
mat4s dest;
dest = proj;
glm_perspective_resize_rh_no(aspect, dest.raw);
return dest;
}
/*!

View File

@@ -127,13 +127,20 @@ glms_perspective_default_rh_zo(float aspect) {
* reized with a right-hand coordinate system and a
* clip-space of [0, 1].
*
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
* like glm_perspective_resize_rh_zo(proj.raw, aspect) to avoid create new mat4
* each time
*
* @param[in, out] proj perspective projection matrix
* @param[in] aspect aspect ratio ( width / height )
*/
CGLM_INLINE
void
mat4s
glms_perspective_resize_rh_zo(mat4s proj, float aspect) {
glm_perspective_resize_rh_zo(aspect, proj.raw);
mat4s dest;
dest = proj;
glm_perspective_resize_rh_zo(aspect, dest.raw);
return dest;
}
/*!