libgoatvr

annotate src/vr.h @ 7:6896f9cf9621

- configure now emits config.status with the current confure invocation - now vr_init will heed the VR_MODULE env var for the name of the module to use - more stuff on the openhmd module
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 19 Sep 2014 15:16:51 +0300
parents
children 3d9ec6fe97d7
rev   line source
nuclear@0 1 #ifndef VR_H_
nuclear@0 2 #define VR_H_
nuclear@0 3
nuclear@0 4 #define VR_OPT_DISPLAY_WIDTH "display-xres"
nuclear@0 5 #define VR_OPT_DISPLAY_HEIGHT "display-yres"
nuclear@0 6 #define VR_OPT_LEYE_XRES "left-eye-xres"
nuclear@0 7 #define VR_OPT_LEYE_YRES "left-eye-yres"
nuclear@0 8 #define VR_OPT_REYE_XRES "right-eye-xres"
nuclear@0 9 #define VR_OPT_REYE_YRES "right-eye-yres"
nuclear@0 10 #define VR_OPT_EYE_HEIGHT "eye-height"
nuclear@0 11 #define VR_OPT_IPD "ipd"
nuclear@0 12 #define VR_OPT_WIN_XOFFS "win-xoffset"
nuclear@0 13 #define VR_OPT_WIN_YOFFS "win-yoffset"
nuclear@0 14
nuclear@0 15 enum {
nuclear@0 16 VR_EYE_LEFT,
nuclear@0 17 VR_EYE_RIGHT
nuclear@0 18 };
nuclear@0 19
nuclear@0 20 #ifdef __cplusplus
nuclear@0 21 extern "C" {
nuclear@0 22 #endif
nuclear@0 23
nuclear@0 24 int vr_init(void);
nuclear@0 25 void vr_shutdown(void);
nuclear@0 26
nuclear@0 27 int vr_module_count(void);
nuclear@0 28 const char *vr_module_name(int idx);
nuclear@0 29
nuclear@0 30 int vr_use_module(int idx);
nuclear@0 31 int vr_use_module_named(const char *name);
nuclear@0 32
nuclear@0 33 void vr_set_opti(const char *optname, int val);
nuclear@0 34 void vr_set_optf(const char *optname, float val);
nuclear@0 35 int vr_get_opti(const char *optname);
nuclear@0 36 float vr_get_optf(const char *optname);
nuclear@0 37
nuclear@0 38 int vr_view_translation(int eye, float *vec);
nuclear@0 39 int vr_view_rotation(int eye, float *quat);
nuclear@0 40
nuclear@0 41 /* returns non-zero if the active vr module provides this kind of matrix
nuclear@0 42 * information, otherwise it returns zero, and sets mat to identity
nuclear@0 43 */
nuclear@0 44 int vr_view_matrix(int eye, float *mat);
nuclear@0 45 int vr_proj_matrix(int eye, float znear, float zfar, float *mat);
nuclear@0 46
nuclear@0 47 void vr_begin(int eye);
nuclear@0 48 void vr_end(void);
nuclear@0 49 int vr_swap_buffers(void);
nuclear@0 50
nuclear@0 51 /* set the output texture or separate textures for each eye */
nuclear@0 52 void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax);
nuclear@0 53 void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax);
nuclear@0 54
nuclear@0 55 void vr_recenter(void);
nuclear@0 56
nuclear@0 57 #ifdef __cplusplus
nuclear@0 58 }
nuclear@0 59 #endif
nuclear@0 60
nuclear@0 61 #endif /* VR_H_ */