rev |
line source |
nuclear@4
|
1 #ifndef VR_H_
|
nuclear@4
|
2 #define VR_H_
|
nuclear@4
|
3
|
nuclear@7
|
4 #define VR_OPT_DISPLAY_WIDTH "display-xres"
|
nuclear@7
|
5 #define VR_OPT_DISPLAY_HEIGHT "display-yres"
|
nuclear@7
|
6 #define VR_OPT_LEYE_XRES "left-eye-xres"
|
nuclear@7
|
7 #define VR_OPT_LEYE_YRES "left-eye-yres"
|
nuclear@7
|
8 #define VR_OPT_REYE_XRES "right-eye-xres"
|
nuclear@7
|
9 #define VR_OPT_REYE_YRES "right-eye-yres"
|
nuclear@7
|
10 #define VR_OPT_EYE_HEIGHT "eye-height"
|
nuclear@7
|
11 #define VR_OPT_IPD "ipd"
|
nuclear@7
|
12
|
nuclear@5
|
13 enum {
|
nuclear@5
|
14 VR_EYE_LEFT,
|
nuclear@5
|
15 VR_EYE_RIGHT
|
nuclear@5
|
16 };
|
nuclear@5
|
17
|
nuclear@4
|
18 #ifdef __cplusplus
|
nuclear@4
|
19 extern "C" {
|
nuclear@4
|
20 #endif
|
nuclear@4
|
21
|
nuclear@4
|
22 int vr_init(void);
|
nuclear@4
|
23 void vr_shutdown(void);
|
nuclear@4
|
24
|
nuclear@4
|
25 int vr_module_count(void);
|
nuclear@4
|
26 const char *vr_module_name(int idx);
|
nuclear@4
|
27
|
nuclear@4
|
28 int vr_use_module(int idx);
|
nuclear@4
|
29 int vr_use_module_named(const char *name);
|
nuclear@4
|
30
|
nuclear@7
|
31 void vr_set_opti(const char *optname, int val);
|
nuclear@7
|
32 void vr_set_optf(const char *optname, float val);
|
nuclear@7
|
33 int vr_get_opti(const char *optname);
|
nuclear@7
|
34 float vr_get_optf(const char *optname);
|
nuclear@7
|
35
|
nuclear@7
|
36 int vr_view_translation(int eye, float *vec);
|
nuclear@7
|
37 int vr_view_rotation(int eye, float *quat);
|
nuclear@5
|
38
|
nuclear@4
|
39 /* returns non-zero if the active vr module provides this kind of matrix
|
nuclear@4
|
40 * information, otherwise it returns zero, and sets mat to identity
|
nuclear@4
|
41 */
|
nuclear@4
|
42 int vr_view_matrix(int eye, float *mat);
|
nuclear@7
|
43 int vr_proj_matrix(int eye, float znear, float zfar, float *mat);
|
nuclear@4
|
44
|
nuclear@5
|
45 void vr_begin(int eye);
|
nuclear@5
|
46 void vr_end(void);
|
nuclear@6
|
47 int vr_swap_buffers(void);
|
nuclear@4
|
48
|
nuclear@7
|
49 /* set the output texture or separate textures for each eye */
|
nuclear@7
|
50 void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax);
|
nuclear@7
|
51 void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax);
|
nuclear@7
|
52
|
nuclear@7
|
53 void vr_recenter(void);
|
nuclear@7
|
54
|
nuclear@4
|
55 #ifdef __cplusplus
|
nuclear@4
|
56 }
|
nuclear@4
|
57 #endif
|
nuclear@4
|
58
|
nuclear@4
|
59 #endif /* VR_H_ */
|