conworlds

annotate src/vr/vr.h @ 20:782ff06817fb

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