diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
| commit | 6b8af9cf83851c075c6c9514b1deaa931c2b19a4 (patch) | |
| tree | 428986b49c32e21d3f7a3c2dfa41858ae0153209 /09-september/tomcat/util/util.h | |
Initial commit
Diffstat (limited to '09-september/tomcat/util/util.h')
| -rw-r--r-- | 09-september/tomcat/util/util.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/09-september/tomcat/util/util.h b/09-september/tomcat/util/util.h new file mode 100644 index 0000000..f09f7cb --- /dev/null +++ b/09-september/tomcat/util/util.h @@ -0,0 +1,27 @@ +#ifndef UTIL_H +#define UTIL_H + +#include "../math/matrix4x4.h" + +#define toRadians(degrees) (degrees * 3.1415926 / 180.0f) +#define toDegrees(radians) (radians * 180.0f / 3.1415926) + +#ifdef DEBUG +#include <stdio.h> +#define myAssert(expr) expr ? 1==1 : fprintf(stderr, "The expresion was not true\n") +#else +#define myAssert(expr) +#endif // DEBUG + +extern unsigned int Util_Hash( const char *str ); +extern void Util_FatalError( const char* fmt, ... ); +extern void Util_CheckGLError(); +extern char* Util_LoadFile( const char* path ); +extern float Util_RandomF(float min, float max); +extern int Util_RandomI(int min, int max); + +extern Vec3 +Util_GetMouseRay(int screenWidth, int screenHeigth, Mat4 *viewMatrix, Mat4 *projectionMatrix, + int mouseX, int mouseY); + +#endif // UTIL_H |
