print mat4

This commit is contained in:
Recep Aslantas
2016-09-11 13:07:47 +03:00
parent f708240ad3
commit f09238a6aa

40
include/cglm-util.h Normal file
View File

@@ -0,0 +1,40 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglm_util_h
#define cglm_util_h
#include "cglm.h"
#include <stdio.h>
#include <stdlib.h>
CGLM_INLINE
void
glm_mat4_print(mat4 matrix,
FILE * __restrict ostream) {
int i;
int j;
#define m 4
#define n 4
fprintf(ostream, "Matrix (%dx%d):\n", m, n);
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++)
fprintf(ostream, "\t%0.2f,", matrix[i][j]);;
fprintf(ostream, "\n");
}
fprintf(ostream, "\n");
#undef m
#undef n
}
#endif /* cglm_util_h */