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