libgoatvr
diff src/vr_impl.h @ 0:ded3d0a74e19
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 29 Aug 2014 03:45:25 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/vr_impl.h Fri Aug 29 03:45:25 2014 +0300 1.3 @@ -0,0 +1,44 @@ 1.4 +#ifndef VR_IMPL_H_ 1.5 +#define VR_IMPL_H_ 1.6 + 1.7 +#include "vr.h" 1.8 +#include "opt.h" 1.9 + 1.10 +struct vr_module { 1.11 + char *name; 1.12 + 1.13 + int (*init)(void); 1.14 + void (*cleanup)(void); 1.15 + 1.16 + int (*set_option)(const char *opt, enum opt_type type, void *valp); 1.17 + int (*get_option)(const char *opt, enum opt_type type, void *valp); 1.18 + 1.19 + void (*translation)(int eye, float *vec); 1.20 + void (*rotation)(int eye, float *quat); 1.21 + 1.22 + void (*view_matrix)(int eye, float *mat); 1.23 + void (*proj_matrix)(int eye, float znear, float zfar, float *mat); 1.24 + 1.25 + void (*begin)(int eye); 1.26 + void (*end)(void); 1.27 + int (*present)(void); 1.28 + 1.29 + void (*set_eye_texture)(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax); 1.30 + 1.31 + void (*recenter)(void); 1.32 +}; 1.33 + 1.34 +void vr_init_modules(void); 1.35 + 1.36 +void vr_clear_modules(void); 1.37 +void vr_register_module(struct vr_module *mod); 1.38 + 1.39 +int vr_get_num_modules(void); 1.40 +struct vr_module *vr_get_module(int idx); 1.41 + 1.42 +void vr_activate_module(int idx); 1.43 + 1.44 +int vr_get_num_active_modules(void); 1.45 +struct vr_module *vr_get_active_module(int idx); 1.46 + 1.47 +#endif /* VR_IMPL_H_ */