1 #ifndef REIS_INCLUDE_MATH_H_
2 #define REIS_INCLUDE_MATH_H_
10 #define PI 141592653589f
14 int isNum(
const char *str);
20 typedef struct { GLfloat x, y; }
vec2;
21 typedef struct { GLfloat x, y, z; }
vec3;
22 typedef struct { GLfloat x, y, z, w; }
vec4;
24 typedef struct { GLfloat a[3*3]; }
mat3;
25 typedef struct { GLfloat a[4*4]; }
mat4;
27 typedef struct { GLfloat x, y, w, h; }
rect;
29 static inline vec2 rsNewvec2( GLfloat x, GLfloat y ) {
return (
vec2) {x, y}; }
30 static inline vec3 rsNewvec3( GLfloat x, GLfloat y, GLfloat z ) {
31 return (
vec3) {x, y, z};
33 static inline vec4 rsNewvec4( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) {
34 return (
vec4) {x, y, z, w};
36 static inline rect rsNewrect( GLfloat x, GLfloat y, GLfloat w, GLfloat h ) {
37 return (
rect) {x, y, w, h};
40 mat3 mat3_identity(
void );
41 mat4 mat4_identity(
void );
43 mat4 mat4_ortho( GLfloat left, GLfloat right, GLfloat bot,
44 GLfloat top, GLfloat near, GLfloat far );
Shared types and functions, accounts for GNU Linux and MacOS specifications.