libgoatvr

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