vrchess
diff 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 diff
1.1 --- a/src/vr/vr.h Thu Aug 21 01:08:03 2014 +0300 1.2 +++ b/src/vr/vr.h Fri Aug 22 16:55:16 2014 +0300 1.3 @@ -1,6 +1,15 @@ 1.4 #ifndef VR_H_ 1.5 #define VR_H_ 1.6 1.7 +#define VR_OPT_DISPLAY_WIDTH "display-xres" 1.8 +#define VR_OPT_DISPLAY_HEIGHT "display-yres" 1.9 +#define VR_OPT_LEYE_XRES "left-eye-xres" 1.10 +#define VR_OPT_LEYE_YRES "left-eye-yres" 1.11 +#define VR_OPT_REYE_XRES "right-eye-xres" 1.12 +#define VR_OPT_REYE_YRES "right-eye-yres" 1.13 +#define VR_OPT_EYE_HEIGHT "eye-height" 1.14 +#define VR_OPT_IPD "ipd" 1.15 + 1.16 enum { 1.17 VR_EYE_LEFT, 1.18 VR_EYE_RIGHT 1.19 @@ -19,22 +28,30 @@ 1.20 int vr_use_module(int idx); 1.21 int vr_use_module_named(const char *name); 1.22 1.23 -/* if we're using a vr module which requires a specific output resolution, vr_display_size 1.24 - * returns non-zero, and writes the size through the xsz/ysz pointers. Otherwise returns 0 1.25 - */ 1.26 -int vr_display_size(int *xsz, int *ysz); 1.27 -int vr_eye_texture_size(int eye, int *xsz, int *ysz); 1.28 +void vr_set_opti(const char *optname, int val); 1.29 +void vr_set_optf(const char *optname, float val); 1.30 +int vr_get_opti(const char *optname); 1.31 +float vr_get_optf(const char *optname); 1.32 + 1.33 +int vr_view_translation(int eye, float *vec); 1.34 +int vr_view_rotation(int eye, float *quat); 1.35 1.36 /* returns non-zero if the active vr module provides this kind of matrix 1.37 * information, otherwise it returns zero, and sets mat to identity 1.38 */ 1.39 int vr_view_matrix(int eye, float *mat); 1.40 -int vr_proj_matrix(int eye, float *mat); 1.41 +int vr_proj_matrix(int eye, float znear, float zfar, float *mat); 1.42 1.43 void vr_begin(int eye); 1.44 void vr_end(void); 1.45 int vr_swap_buffers(void); 1.46 1.47 +/* set the output texture or separate textures for each eye */ 1.48 +void vr_output_texture(unsigned int tex, float umin, float vmin, float umax, float vmax); 1.49 +void vr_output_texture_eye(int eye, unsigned int tex, float umin, float vmin, float umax, float vmax); 1.50 + 1.51 +void vr_recenter(void); 1.52 + 1.53 #ifdef __cplusplus 1.54 } 1.55 #endif