oculus1

annotate src/vr.h @ 16:f3672317e5c2

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