libgoatvr
diff src/opt.h @ 19:437fe32ac633
ops... wasn't handling the stereo eye separation correctly.
also fixed a bug in vr_libovr.c causing an assertion inside LibOVR when ovrHmd_GetEyePose was called as a result of calls to view_rotation or view_translation outside of vr_begin/vr_end
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 04 Oct 2014 03:39:14 +0300 |
parents | ded3d0a74e19 |
children |
line diff
1.1 --- a/src/opt.h Fri Oct 03 23:07:27 2014 +0300 1.2 +++ b/src/opt.h Sat Oct 04 03:39:14 2014 +0300 1.3 @@ -1,12 +1,13 @@ 1.4 #ifndef OPT_H_ 1.5 #define OPT_H_ 1.6 1.7 -enum opt_type { OTYPE_INT, OTYPE_FLOAT }; 1.8 +enum opt_type { OTYPE_INT, OTYPE_FLOAT, OTYPE_VEC }; 1.9 1.10 struct option { 1.11 enum opt_type type; 1.12 int ival; 1.13 float fval; 1.14 + float vval[4]; 1.15 }; 1.16 1.17 void *create_options(void); 1.18 @@ -14,8 +15,13 @@ 1.19 1.20 void set_option_int(void *optdb, const char *key, int val); 1.21 void set_option_float(void *optdb, const char *key, float val); 1.22 +void set_option_vec(void *optdb, const char *key, float *val); 1.23 +/* convenience functions */ 1.24 +void set_option_vec3f(void *optdb, const char *key, float x, float y, float z); 1.25 +void set_option_vec4f(void *optdb, const char *key, float x, float y, float z, float w); 1.26 1.27 int get_option_int(void *optdb, const char *key, int *val); 1.28 int get_option_float(void *optdb, const char *key, float *val); 1.29 +int get_option_vec(void *optdb, const char *key, float *val); 1.30 1.31 #endif /* OPT_H_ */