conworlds

diff src/vr/vr.h @ 5:8b7da5ab814e

vr wrapper in progress
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 20 Aug 2014 16:34:43 +0300
parents e6948e131526
children 3c36bc28c6c2
line diff
     1.1 --- a/src/vr/vr.h	Wed Aug 20 06:33:43 2014 +0300
     1.2 +++ b/src/vr/vr.h	Wed Aug 20 16:34:43 2014 +0300
     1.3 @@ -1,6 +1,11 @@
     1.4  #ifndef VR_H_
     1.5  #define VR_H_
     1.6  
     1.7 +enum {
     1.8 +	VR_EYE_LEFT,
     1.9 +	VR_EYE_RIGHT
    1.10 +};
    1.11 +
    1.12  #ifdef __cplusplus
    1.13  extern "C" {
    1.14  #endif
    1.15 @@ -14,17 +19,21 @@
    1.16  int vr_use_module(int idx);
    1.17  int vr_use_module_named(const char *name);
    1.18  
    1.19 +/* if we're using a vr module which requires a specific output resolution, vr_display_size
    1.20 + * returns non-zero, and writes the size through the xsz/ysz pointers. Otherwise returns 0
    1.21 + */
    1.22 +int vr_display_size(int *xsz, int *ysz);
    1.23 +int vr_eye_texture_size(int eye, int *xsz, int *ysz);
    1.24 +
    1.25  /* returns non-zero if the active vr module provides this kind of matrix
    1.26   * information, otherwise it returns zero, and sets mat to identity
    1.27   */
    1.28  int vr_view_matrix(int eye, float *mat);
    1.29  int vr_proj_matrix(int eye, float *mat);
    1.30  
    1.31 -/* fbtex should be a texture containing both eye views side by side (LR) */
    1.32 -void vr_present(unsigned int fbtex);
    1.33 -
    1.34 -/* set the area of the framebuffer texture to be used */
    1.35 -void vr_fbrect(float u, float umax, float v, float vmax);
    1.36 +void vr_begin(int eye);
    1.37 +void vr_end(void);
    1.38 +void vr_present(void);
    1.39  
    1.40  #ifdef __cplusplus
    1.41  }