mirror of
https://github.com/recp/cglm.git
synced 2025-12-26 10:35:10 +00:00
Merge pull request #332 from EasyIP2023/fix/mat2x3
add missing mat2x# test and mat2x3 window headers
This commit is contained in:
@@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#define GLM_MAT2X3_ZERO_INIT {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}
|
#define GLM_MAT2X3_ZERO_INIT {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLM_MAT2X3_ZERO ((mat2x3)GLM_MAT2X3_ZERO_INIT)
|
#define GLM_MAT2X3_ZERO GLM_MAT2X3_ZERO_INIT
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Create mat2x3 matrix from pointer
|
* @brief Create mat2x3 matrix from pointer
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#define GLM_MAT2X4_ZERO_INIT {{0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f, 0.0f}}
|
#define GLM_MAT2X4_ZERO_INIT {{0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f, 0.0f}}
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLM_MAT2X4_ZERO GLM_MAT2X4_ZERO_INIT
|
#define GLM_MAT2X4_ZERO GLM_MAT2X4_ZERO_INIT
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Create mat2x4 matrix from pointer
|
* @brief Create mat2x4 matrix from pointer
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
/* api definition */
|
/* api definition */
|
||||||
#define glms_mat2x3_(NAME) CGLM_STRUCTAPI(mat2x3, NAME)
|
#define glms_mat2x3_(NAME) CGLM_STRUCTAPI(mat2x3, NAME)
|
||||||
|
|
||||||
#define GLMS_MAT2X3_ZERO_INIT {GLM_MAT2X3_ZERO_INIT}
|
#define GLMS_MAT2X3_ZERO_INIT {GLM_MAT2X3_ZERO_INIT}
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLMS_MAT2X3_ZERO ((mat2x3s)GLMS_MAT2X3_ZERO_INIT)
|
#define GLMS_MAT2X3_ZERO ((mat2x3s)GLMS_MAT2X3_ZERO_INIT)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Create mat2x3 matrix from pointer
|
* @brief Create mat2x3 matrix from pointer
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
/* api definition */
|
/* api definition */
|
||||||
#define glms_mat2x4_(NAME) CGLM_STRUCTAPI(mat2x4, NAME)
|
#define glms_mat2x4_(NAME) CGLM_STRUCTAPI(mat2x4, NAME)
|
||||||
|
|
||||||
#define GLMS_MAT2X4_ZERO_INIT {GLM_MAT2X4_ZERO_INIT}
|
#define GLMS_MAT2X4_ZERO_INIT {GLM_MAT2X4_ZERO_INIT}
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLMS_MAT2X4_ZERO ((mat2x4s)GLMS_MAT2X4_ZERO_INIT)
|
#define GLMS_MAT2X4_ZERO ((mat2x4s)GLMS_MAT2X4_ZERO_INIT)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Create mat2x4 matrix from pointer
|
* @brief Create mat2x4 matrix from pointer
|
||||||
|
|||||||
@@ -10,16 +10,15 @@
|
|||||||
#ifndef CGLM_TEST_MAT2X3_ONCE
|
#ifndef CGLM_TEST_MAT2X3_ONCE
|
||||||
#define CGLM_TEST_MAT2X3_ONCE
|
#define CGLM_TEST_MAT2X3_ONCE
|
||||||
|
|
||||||
TEST_IMPL(MACRO_GLM_MAT2X3_ZERO_INIT) {
|
TEST_IMPL(MACRO_GLM_MAT2X3_ZERO_INIT) {
|
||||||
mat2x3 m = GLM_MAT2X3_ZERO_INIT;
|
mat2x3 mat2x3_zero = GLM_MAT2X3_ZERO_INIT;
|
||||||
|
test_assert_mat2x3_eq_zero(mat2x3_zero);
|
||||||
ASSERT(test_eq(m[0][0], 0.0f))
|
TEST_SUCCESS
|
||||||
ASSERT(test_eq(m[0][1], 0.0f))
|
}
|
||||||
ASSERT(test_eq(m[0][2], 0.0f))
|
|
||||||
ASSERT(test_eq(m[1][0], 0.0f))
|
|
||||||
ASSERT(test_eq(m[1][1], 0.0f))
|
|
||||||
ASSERT(test_eq(m[1][2], 0.0f))
|
|
||||||
|
|
||||||
|
TEST_IMPL(MACRO_GLM_MAT2X3_ZERO) {
|
||||||
|
mat2x3 mat2x3_zero = GLM_MAT2X3_ZERO;
|
||||||
|
test_assert_mat2x3_eq_zero(mat2x3_zero);
|
||||||
TEST_SUCCESS
|
TEST_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,12 @@
|
|||||||
|
|
||||||
TEST_IMPL(mat2x3s_zero_init) {
|
TEST_IMPL(mat2x3s_zero_init) {
|
||||||
mat2x3s mat2x3_zero = GLMS_MAT2X3_ZERO_INIT;
|
mat2x3s mat2x3_zero = GLMS_MAT2X3_ZERO_INIT;
|
||||||
mat2x3 mat2x3_zero_a = GLM_MAT2X3_ZERO_INIT;
|
test_assert_mat2x3_eq_zero(mat2x3_zero.raw);
|
||||||
test_assert_mat2x3_eq_zero(mat2x3_zero_a);
|
TEST_SUCCESS
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_IMPL(mat2x3s_zero) {
|
||||||
|
mat2x3s mat2x3_zero = GLMS_MAT2X3_ZERO;
|
||||||
test_assert_mat2x3_eq_zero(mat2x3_zero.raw);
|
test_assert_mat2x3_eq_zero(mat2x3_zero.raw);
|
||||||
TEST_SUCCESS
|
TEST_SUCCESS
|
||||||
}
|
}
|
||||||
@@ -21,6 +25,12 @@ TEST_IMPL(mat2x4s_zero_init) {
|
|||||||
TEST_SUCCESS
|
TEST_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_IMPL(mat2x4s_zero) {
|
||||||
|
mat2x4s mat2x4_zero = GLMS_MAT2X4_ZERO;
|
||||||
|
test_assert_mat2x4_eq_zero(mat2x4_zero.raw);
|
||||||
|
TEST_SUCCESS
|
||||||
|
}
|
||||||
|
|
||||||
TEST_IMPL(mat3s_identity_init) {
|
TEST_IMPL(mat3s_identity_init) {
|
||||||
mat3s mat3_identity = GLMS_MAT3_IDENTITY_INIT;
|
mat3s mat3_identity = GLMS_MAT3_IDENTITY_INIT;
|
||||||
mat3 mat3_identity_a = GLM_MAT3_IDENTITY_INIT;
|
mat3 mat3_identity_a = GLM_MAT3_IDENTITY_INIT;
|
||||||
|
|||||||
12
test/tests.h
12
test/tests.h
@@ -228,6 +228,8 @@ TEST_DECLARE(glmc_mat2_swap_row)
|
|||||||
TEST_DECLARE(glmc_mat2_rmc)
|
TEST_DECLARE(glmc_mat2_rmc)
|
||||||
TEST_DECLARE(glmc_mat2_make)
|
TEST_DECLARE(glmc_mat2_make)
|
||||||
|
|
||||||
|
TEST_DECLARE(MACRO_GLM_MAT2X3_ZERO_INIT)
|
||||||
|
TEST_DECLARE(MACRO_GLM_MAT2X3_ZERO)
|
||||||
TEST_DECLARE(glm_mat2x3_make)
|
TEST_DECLARE(glm_mat2x3_make)
|
||||||
|
|
||||||
TEST_DECLARE(glmc_mat2x3_make)
|
TEST_DECLARE(glmc_mat2x3_make)
|
||||||
@@ -867,6 +869,10 @@ TEST_DECLARE(glmc_ivec4_clamp)
|
|||||||
TEST_DECLARE(glmc_ivec4_abs)
|
TEST_DECLARE(glmc_ivec4_abs)
|
||||||
|
|
||||||
/* structs */
|
/* structs */
|
||||||
|
TEST_DECLARE(mat2x3s_zero_init)
|
||||||
|
TEST_DECLARE(mat2x3s_zero)
|
||||||
|
TEST_DECLARE(mat2x4s_zero_init)
|
||||||
|
TEST_DECLARE(mat2x4s_zero)
|
||||||
TEST_DECLARE(mat3s_identity_init)
|
TEST_DECLARE(mat3s_identity_init)
|
||||||
TEST_DECLARE(mat3s_zero_init)
|
TEST_DECLARE(mat3s_zero_init)
|
||||||
TEST_DECLARE(mat4s_identity_init)
|
TEST_DECLARE(mat4s_identity_init)
|
||||||
@@ -1093,6 +1099,8 @@ TEST_LIST {
|
|||||||
TEST_ENTRY(glmc_mat2_rmc)
|
TEST_ENTRY(glmc_mat2_rmc)
|
||||||
TEST_ENTRY(glmc_mat2_make)
|
TEST_ENTRY(glmc_mat2_make)
|
||||||
|
|
||||||
|
TEST_ENTRY(MACRO_GLM_MAT2X3_ZERO_INIT)
|
||||||
|
TEST_ENTRY(MACRO_GLM_MAT2X3_ZERO)
|
||||||
TEST_ENTRY(glm_mat2x3_make)
|
TEST_ENTRY(glm_mat2x3_make)
|
||||||
|
|
||||||
TEST_ENTRY(glmc_mat2x3_make)
|
TEST_ENTRY(glmc_mat2x3_make)
|
||||||
@@ -1729,6 +1737,10 @@ TEST_LIST {
|
|||||||
TEST_ENTRY(glmc_ivec4_abs)
|
TEST_ENTRY(glmc_ivec4_abs)
|
||||||
|
|
||||||
/* structs */
|
/* structs */
|
||||||
|
TEST_ENTRY(mat2x3s_zero_init)
|
||||||
|
TEST_ENTRY(mat2x3s_zero)
|
||||||
|
TEST_ENTRY(mat2x4s_zero_init)
|
||||||
|
TEST_ENTRY(mat2x4s_zero)
|
||||||
TEST_ENTRY(mat3s_identity_init)
|
TEST_ENTRY(mat3s_identity_init)
|
||||||
TEST_ENTRY(mat3s_zero_init)
|
TEST_ENTRY(mat3s_zero_init)
|
||||||
TEST_ENTRY(mat4s_identity_init)
|
TEST_ENTRY(mat4s_identity_init)
|
||||||
|
|||||||
@@ -402,6 +402,9 @@
|
|||||||
<ClInclude Include="..\include\cglm\call\mat2.h">
|
<ClInclude Include="..\include\cglm\call\mat2.h">
|
||||||
<Filter>include\cglm\call</Filter>
|
<Filter>include\cglm\call</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm\call\mat2x3.h">
|
||||||
|
<Filter>include\cglm\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\include\cglm\call\mat2x4.h">
|
<ClInclude Include="..\include\cglm\call\mat2x4.h">
|
||||||
<Filter>include\cglm\call</Filter>
|
<Filter>include\cglm\call</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -411,6 +414,9 @@
|
|||||||
<ClInclude Include="..\include\cglm\struct\mat2.h">
|
<ClInclude Include="..\include\cglm\struct\mat2.h">
|
||||||
<Filter>include\cglm\struct</Filter>
|
<Filter>include\cglm\struct</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm\struct\mat2x3.h">
|
||||||
|
<Filter>include\cglm\struct</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\include\cglm\struct\mat2x4.h">
|
<ClInclude Include="..\include\cglm\struct\mat2x4.h">
|
||||||
<Filter>include\cglm\struct</Filter>
|
<Filter>include\cglm\struct</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -420,6 +426,9 @@
|
|||||||
<ClInclude Include="..\include\cglm\mat2.h">
|
<ClInclude Include="..\include\cglm\mat2.h">
|
||||||
<Filter>include\cglm</Filter>
|
<Filter>include\cglm</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm\mat2x3.h">
|
||||||
|
<Filter>include\cglm</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\include\cglm\mat2x4.h">
|
<ClInclude Include="..\include\cglm\mat2x4.h">
|
||||||
<Filter>include\cglm</Filter>
|
<Filter>include\cglm</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|||||||
Reference in New Issue
Block a user