diff options
Diffstat (limited to '08-august/src/util/util.h')
| -rw-r--r-- | 08-august/src/util/util.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/08-august/src/util/util.h b/08-august/src/util/util.h new file mode 100644 index 0000000..7227547 --- /dev/null +++ b/08-august/src/util/util.h @@ -0,0 +1,25 @@ +#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 void Util_FatalError( const char* error, ... ); +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_t +Util_GetMouseRay(int screenWidth, int screenHeigth, mat4_t *viewMatrix, mat4_t *projectionMatrix, + int mouseX, int mouseY); + +#endif // UTIL_H |
