conworlds

view src/vr/vr.h @ 7:bd8202d6d28d

some progress...
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 22 Aug 2014 16:55:16 +0300
parents 3c36bc28c6c2
children 5dc4e2b8f6f5
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"
13 enum {
14 VR_EYE_LEFT,
15 VR_EYE_RIGHT
16 };
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
22 int vr_init(void);
23 void vr_shutdown(void);
25 int vr_module_count(void);
26 const char *vr_module_name(int idx);
28 int vr_use_module(int idx);
29 int vr_use_module_named(const char *name);
31 void vr_set_opti(const char *optname, int val);
32 void vr_set_optf(const char *optname, float val);
33 int vr_get_opti(const char *optname);
34 float vr_get_optf(const char *optname);
36 int vr_view_translation(int eye, float *vec);
37 int vr_view_rotation(int eye, float *quat);
39 /* returns non-zero if the active vr module provides this kind of matrix
40 * information, otherwise it returns zero, and sets mat to identity
41 */
42 int vr_view_matrix(int eye, float *mat);
43 int vr_proj_matrix(int eye, float znear, float zfar, float *mat);
45 void vr_begin(int eye);
46 void vr_end(void);
47 int vr_swap_buffers(void);
49 /* set the output texture or separate textures for each eye */
50 void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax);
51 void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax);
53 void vr_recenter(void);
55 #ifdef __cplusplus
56 }
57 #endif
59 #endif /* VR_H_ */