goat3dgfx

annotate src/vr.h @ 34:3eb6c8f89fe1

merge
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Mar 2014 17:41:10 +0200
parents
children
rev   line source
nuclear@11 1 #ifndef GOAT3DGFX_VR_H_
nuclear@11 2 #define GOAT3DGFX_VR_H_
nuclear@11 3
nuclear@11 4 /* VR mode init options */
nuclear@11 5 enum vr_init_mode {
nuclear@11 6 VR_INIT_NONE,
nuclear@11 7 VR_INIT_OCULUS,
nuclear@11 8 VR_INIT_STEREO
nuclear@11 9 };
nuclear@11 10
nuclear@11 11 /* possible eye values */
nuclear@11 12 enum {
nuclear@11 13 VR_EYE_CENTER,
nuclear@11 14 VR_EYE_LEFT,
nuclear@11 15 VR_EYE_RIGHT
nuclear@11 16 };
nuclear@11 17
nuclear@11 18 #ifdef __cplusplus
nuclear@11 19 extern "C" {
nuclear@11 20 #endif
nuclear@11 21
nuclear@11 22 int vr_init(enum vr_init_mode mode);
nuclear@11 23 void vr_shutdown(void);
nuclear@11 24
nuclear@11 25 const char *vr_get_display_name(void);
nuclear@11 26 void vr_get_display_pos(int *xptr, int *yptr);
nuclear@11 27
nuclear@11 28 int vr_get_width(void);
nuclear@11 29 int vr_get_height(void);
nuclear@11 30
nuclear@11 31 float vr_get_fov(void);
nuclear@11 32 float vr_get_aspect(void);
nuclear@11 33
nuclear@11 34 void vr_set_eyedist(float ipd);
nuclear@11 35 float vr_get_eyedist(void);
nuclear@11 36
nuclear@11 37 /* expects an array of 4 barrel distortion coefficients:
nuclear@11 38 * polar scale: k_0 + k_1 r^2 + k_2 r^4 + k_3 r^6
nuclear@11 39 */
nuclear@11 40 void vr_set_distort(const float *coef);
nuclear@11 41 void vr_get_distort(float *coef);
nuclear@11 42
nuclear@11 43 void vr_set_prediction_sec(float dt);
nuclear@11 44 float vr_get_prediction_sec(void);
nuclear@11 45
nuclear@11 46 void vr_get_view_matrix(float *res, int eye);
nuclear@11 47 void vr_get_proj_matrix(float *res, int eye);
nuclear@11 48
nuclear@11 49 /* expects an array of at least 3 floats (x, y, z, offset). */
nuclear@11 50 void vr_get_translation(float *offs);
nuclear@11 51 /* expects an array of at least 4 floats (x, y, z, w, quaternion). */
nuclear@11 52 void vr_get_rotation(float *quat);
nuclear@11 53 /* expects an array of at least 3 floats (pitch, yaw, roll, angles). */
nuclear@11 54 void vr_get_rotation_euler(float *euler);
nuclear@11 55
nuclear@11 56 /* OpenGL stuff */
nuclear@11 57 void vr_draw_eye(int eye, unsigned int tex, float tex_scale_x, float tex_scale_y);
nuclear@11 58
nuclear@11 59 #ifdef __cplusplus
nuclear@11 60 }
nuclear@11 61 #endif
nuclear@11 62
nuclear@11 63 #endif /* GOAT3DGFX_VR_H_ */