diff options
| author | Aaditya Dhruv <[email protected]> | 2026-01-25 15:10:37 -0600 |
|---|---|---|
| committer | Aaditya Dhruv <[email protected]> | 2026-01-25 15:10:37 -0600 |
| commit | 118980e02e59ff31871df59dce257075394f3533 (patch) | |
| tree | 26fba4492bb4b561d21bf49b35d892a821d54fab /include/cglm/struct/io.h | |
| parent | 0e6e1245b70df4dfcba135d50e1b53d1a8ef7eb8 (diff) | |
wip
Diffstat (limited to 'include/cglm/struct/io.h')
| -rw-r--r-- | include/cglm/struct/io.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/include/cglm/struct/io.h b/include/cglm/struct/io.h new file mode 100644 index 0000000..900c2a8 --- /dev/null +++ b/include/cglm/struct/io.h @@ -0,0 +1,107 @@ +/* + * Copyright (c), Recep Aslantas. + * + * MIT License (MIT), http://opensource.org/licenses/MIT + * Full license can be found in the LICENSE file + */ + +/* + Functions: + CGLM_INLINE void glms_mat4_print(mat4s matrix, FILE *ostream); + CGLM_INLINE void glms_mat3_print(mat3s matrix, FILE *ostream); + CGLM_INLINE void glms_vec4_print(vec4s vec, FILE *ostream); + CGLM_INLINE void glms_ivec4_print(ivec3s vec, FILE *ostream); + CGLM_INLINE void glms_vec3_print(vec3s vec, FILE *ostream); + CGLM_INLINE void glms_ivec3_print(ivec3s vec, FILE *ostream); + CGLM_INLINE void glms_vec2_print(vec2s vec, FILE *ostream); + CGLM_INLINE void glms_ivec2_print(ivec3s vec, FILE *ostream); + CGLM_INLINE void glms_versor_print(versor vec, FILE *ostream); + CGLM_INLINE void glms_aabb_print(vec3s bbox[2], const char *tag, FILE *ostream); + */ + +#ifndef cglms_ios_h +#define cglms_ios_h + +#include "../common.h" +#include "../io.h" +#include "mat4.h" + +#include <stdio.h> +#include <stdlib.h> + +CGLM_INLINE +void +glms_mat4_print(mat4s matrix, + FILE * __restrict ostream) { + + glm_mat4_print(matrix.raw, ostream); +} + +CGLM_INLINE +void +glms_mat3_print(mat3s matrix, + FILE * __restrict ostream) { + glm_mat3_print(matrix.raw, ostream); +} + +CGLM_INLINE +void +glms_vec4_print(vec4s vec, + FILE * __restrict ostream) { + glm_vec4_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_ivec4_print(ivec4s vec, + FILE * __restrict ostream) { + glm_ivec4_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_vec3_print(vec3s vec, + FILE * __restrict ostream) { + glm_vec3_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_ivec3_print(ivec3s vec, + FILE * __restrict ostream) { + glm_ivec3_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_vec2_print(vec2s vec, + FILE * __restrict ostream) { + glm_vec2_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_ivec2_print(ivec2s vec, + FILE * __restrict ostream) { + glm_ivec2_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_versor_print(versors vec, + FILE * __restrict ostream) { + glm_versor_print(vec.raw, ostream); +} + +CGLM_INLINE +void +glms_aabb_print(vec3s bbox[2], + const char * __restrict tag, + FILE * __restrict ostream) { + vec3 rawBbox[2]; + + glms_vec3_(unpack)(rawBbox, bbox, 2); + glm_aabb_print(rawBbox, tag, ostream); +} + +#endif /* cglms_ios_h */ |
