1 // 2 // types.h 3 // CubicVR2 4 // 5 // Created by Charles J. Cliffe on 2013-02-21. 6 // Copyright (c) 2013 Charles J. Cliffe. All rights reserved. 7 // 8 9 #ifndef CubicVR2_types_h 10 #define CubicVR2_types_h 11 12 namespace CubicVR { 13 14 typedef double __float64; 15 typedef float __float32; 16 17 typedef __float32 __float; 18 19 #define COMBINE(x,y) x ## y 20 #define floatSG(c, x,y) \ 21 __float COMBINE(get,x)() { return y; } \ 22 c & COMBINE(set,x)(__float value) { y = value; return *this; } 23 #define intSG(c, x,y) \ 24 int COMBINE(get,x)() { return y; } \ 25 c & COMBINE(set,x)(int value) { y = value; return *this; } 26 #define uintSG(c, x,y) \ 27 unsigned int COMBINE(get,x)() { return y; } \ 28 c & COMBINE(set,x)(unsigned int value) { y = value; return *this; } 29 #define boolSG(c,x,y) \ 30 bool COMBINE(get,x)() { return y; } \ 31 c & COMBINE(set,x)(bool value) { y = value; return *this; } 32 #define stringSG(c,x,y) \ 33 string COMBINE(get,x)() { return y; } \ 34 c & COMBINE(set,x)(string value) { y = value; return *this; } 35 #define isBoolSG(c,x,y) \ 36 bool COMBINE(is,x)() { return y; } \ 37 c & COMBINE(set,x)(bool value) { y = value; return *this; } 38 39 } 40 41 #include <cmath> 42 #ifndef M_PI 43 #define M_PI 3.14159265358979323846 44 #endif 45 46 #endif 47