libgoatvr

view src/vr.h @ 11:34d4643d61f9

remove _opt suffix from vr_get_opt/vr_set_opt, and _OPT_from the predefined names
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 24 Sep 2014 10:18:42 +0300
parents 3d9ec6fe97d7
children b536bd21b37f
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 /* unit: meters */
14 #define VR_EYE_HEIGHT "eye-height"
15 #define VR_IPD "ipd"
17 enum {
18 VR_EYE_LEFT,
19 VR_EYE_RIGHT
20 };
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 int vr_init(void);
27 void vr_shutdown(void);
29 int vr_module_count(void);
30 const char *vr_module_name(int idx);
32 int vr_use_module(int idx);
33 int vr_use_module_named(const char *name);
35 void vr_seti(const char *optname, int val);
36 void vr_setf(const char *optname, float val);
37 int vr_geti(const char *optname);
38 float vr_getf(const char *optname);
40 int vr_view_translation(int eye, float *vec);
41 int vr_view_rotation(int eye, float *quat);
43 /* returns non-zero if the active vr module provides this kind of matrix
44 * information, otherwise it returns zero, and sets mat to identity
45 */
46 int vr_view_matrix(int eye, float *mat);
47 int vr_proj_matrix(int eye, float znear, float zfar, float *mat);
49 void vr_begin(int eye);
50 void vr_end(void);
51 int vr_swap_buffers(void);
53 /* set the output texture or separate textures for each eye */
54 void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax);
55 void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax);
57 void vr_recenter(void);
59 #ifdef __cplusplus
60 }
61 #endif
63 #endif /* VR_H_ */