|
|
@@ -12,6 +12,10 @@ |
|
|
|
# include "config.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef ANDROID_NDK |
|
|
|
# include <android/log.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
#include <cstdio> |
|
|
|
#include <cstdlib> /* free() */ |
|
|
|
#include <cstring> /* strdup() */ |
|
|
@@ -65,6 +69,31 @@ template<> mat4 mat4::invert() const |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
template<> void mat4::printf() const |
|
|
|
{ |
|
|
|
mat4 const &p = *this; |
|
|
|
|
|
|
|
#ifdef ANDROID_NDK |
|
|
|
__android_log_print(ANDROID_LOG_INFO, "LOL", |
|
|
|
"[ %6.6f %6.6f %6.6f %6.6f", p[0][0], p[1][0], p[2][0], p[3][0]); |
|
|
|
__android_log_print(ANDROID_LOG_INFO, "LOL", |
|
|
|
" %6.6f %6.6f %6.6f %6.6f", p[0][1], p[1][1], p[2][1], p[3][1]); |
|
|
|
__android_log_print(ANDROID_LOG_INFO, "LOL", |
|
|
|
" %6.6f %6.6f %6.6f %6.6f", p[0][2], p[1][2], p[2][2], p[3][2]); |
|
|
|
__android_log_print(ANDROID_LOG_INFO, "LOL", |
|
|
|
" %6.6f %6.6f %6.6f %6.6f ]", p[0][3], p[1][3], p[2][3], p[3][3]); |
|
|
|
#else |
|
|
|
fprintf(stderr, "[ %6.6f %6.6f %6.6f %6.6f\n", |
|
|
|
p[0][0], p[1][0], p[2][0], p[3][0]); |
|
|
|
fprintf(stderr, " %6.6f %6.6f %6.6f %6.6f\n", |
|
|
|
p[0][1], p[1][1], p[2][1], p[3][1]); |
|
|
|
fprintf(stderr, " %6.6f %6.6f %6.6f %6.6f\n", |
|
|
|
p[0][2], p[1][2], p[2][2], p[3][2]); |
|
|
|
fprintf(stderr, " %6.6f %6.6f %6.6f %6.6f ]\n", |
|
|
|
p[0][3], p[1][3], p[2][3], p[3][3]); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
template<> mat4 mat4::ortho(float left, float right, float bottom, |
|
|
|
float top, float near, float far) |
|
|
|
{ |
|
|
|