aboutsummaryrefslogtreecommitdiff
path: root/09-september/tomcat/util/util.h
blob: f09f7cb14ebb54ba4e2e68943fcca2d390fb80d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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