libgoatvr

annotate src/vr.h @ 15:27fcd4c2969d

added VR_EYE_RES_SCALE option
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 25 Sep 2014 08:50:50 +0300
parents b536bd21b37f
children b2d902fff68d
rev   line source
nuclear@0 1 #ifndef VR_H_
nuclear@0 2 #define VR_H_
nuclear@0 3
nuclear@8 4 /* unit: pixels */
nuclear@11 5 #define VR_DISPLAY_WIDTH "display-xres"
nuclear@11 6 #define VR_DISPLAY_HEIGHT "display-yres"
nuclear@11 7 #define VR_LEYE_XRES "left-eye-xres"
nuclear@11 8 #define VR_LEYE_YRES "left-eye-yres"
nuclear@11 9 #define VR_REYE_XRES "right-eye-xres"
nuclear@11 10 #define VR_REYE_YRES "right-eye-yres"
nuclear@11 11 #define VR_WIN_XOFFS "win-xoffset"
nuclear@11 12 #define VR_WIN_YOFFS "win-yoffset"
nuclear@15 13 #define VR_EYE_RES_SCALE "eye-res-scale" /* default 1 */
nuclear@8 14 /* unit: meters */
nuclear@11 15 #define VR_EYE_HEIGHT "eye-height"
nuclear@11 16 #define VR_IPD "ipd"
nuclear@0 17
nuclear@0 18 enum {
nuclear@0 19 VR_EYE_LEFT,
nuclear@0 20 VR_EYE_RIGHT
nuclear@0 21 };
nuclear@0 22
nuclear@0 23 #ifdef __cplusplus
nuclear@0 24 extern "C" {
nuclear@0 25 #endif
nuclear@0 26
nuclear@0 27 int vr_init(void);
nuclear@0 28 void vr_shutdown(void);
nuclear@0 29
nuclear@0 30 int vr_module_count(void);
nuclear@0 31 const char *vr_module_name(int idx);
nuclear@0 32
nuclear@0 33 int vr_use_module(int idx);
nuclear@0 34 int vr_use_module_named(const char *name);
nuclear@0 35
nuclear@11 36 void vr_seti(const char *optname, int val);
nuclear@11 37 void vr_setf(const char *optname, float val);
nuclear@11 38 int vr_geti(const char *optname);
nuclear@11 39 float vr_getf(const char *optname);
nuclear@12 40 /* variants of the get functions, with an additional "default value"
nuclear@12 41 * argument, which is returned if the requested option is missing
nuclear@12 42 */
nuclear@12 43 int vr_geti_def(const char *optname, int def_val);
nuclear@12 44 float vr_getf_def(const char *optname, float def_val);
nuclear@0 45
nuclear@0 46 int vr_view_translation(int eye, float *vec);
nuclear@0 47 int vr_view_rotation(int eye, float *quat);
nuclear@0 48
nuclear@0 49 /* returns non-zero if the active vr module provides this kind of matrix
nuclear@0 50 * information, otherwise it returns zero, and sets mat to identity
nuclear@0 51 */
nuclear@0 52 int vr_view_matrix(int eye, float *mat);
nuclear@0 53 int vr_proj_matrix(int eye, float znear, float zfar, float *mat);
nuclear@0 54
nuclear@0 55 void vr_begin(int eye);
nuclear@0 56 void vr_end(void);
nuclear@0 57 int vr_swap_buffers(void);
nuclear@0 58
nuclear@0 59 /* set the output texture or separate textures for each eye */
nuclear@0 60 void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax);
nuclear@0 61 void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax);
nuclear@0 62
nuclear@0 63 void vr_recenter(void);
nuclear@0 64
nuclear@0 65 #ifdef __cplusplus
nuclear@0 66 }
nuclear@0 67 #endif
nuclear@0 68
nuclear@0 69 #endif /* VR_H_ */