X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2Fspaceball%2Fvmath.h;h=249a504f3e99fb4db5b6aea2ab5e908283a8e129;hb=ea46c9f7ece4897adb3e0f529b082cea51442cd8;hp=5010c07acf464d83841623cd6e9b5dd1e899039d;hpb=bb97ecab3add22cf774d3bb8bdb9d1be537cc524;p=freeglut diff --git a/progs/demos/spaceball/vmath.h b/progs/demos/spaceball/vmath.h index 5010c07..249a504 100644 --- a/progs/demos/spaceball/vmath.h +++ b/progs/demos/spaceball/vmath.h @@ -1,6 +1,13 @@ #ifndef VMATH_H_ #define VMATH_H_ +#if defined(WIN32) +#define INLINE +#else +#define INLINE inline +#endif + + typedef struct { float x, y, z; } vec3_t; typedef struct { float x, y, z, w; } vec4_t; @@ -9,23 +16,23 @@ typedef vec4_t quat_t; typedef float mat4_t[4][4]; /* vector functions */ -static inline vec3_t v3_cons(float x, float y, float z); -static inline float v3_dot(vec3_t v1, vec3_t v2); +static INLINE vec3_t v3_cons(float x, float y, float z); +static INLINE float v3_dot(vec3_t v1, vec3_t v2); /* quaternion functions */ -static inline quat_t quat_cons(float s, float x, float y, float z); -static inline vec3_t quat_vec(quat_t q); -static inline quat_t quat_mul(quat_t q1, quat_t q2); -static inline void quat_to_mat(mat4_t res, quat_t q); +static INLINE quat_t quat_cons(float s, float x, float y, float z); +static INLINE vec3_t quat_vec(quat_t q); +static INLINE quat_t quat_mul(quat_t q1, quat_t q2); +static INLINE void quat_to_mat(mat4_t res, quat_t q); quat_t quat_rotate(quat_t q, float angle, float x, float y, float z); /* matrix functions */ -static inline void m4_cons(mat4_t m, - float m11, float m12, float m13, float m14, - float m21, float m22, float m23, float m24, - float m31, float m32, float m33, float m34, - float m41, float m42, float m43, float m44); +static INLINE void m4_cons(mat4_t m, + float m11, float m12, float m13, float m14, + float m21, float m22, float m23, float m24, + float m31, float m32, float m33, float m34, + float m41, float m42, float m43, float m44); #include "vmath.inl" -#endif /* VMATH_H_ */ +#endif /* VMATH_H_ */