vrchess
diff src/vr/vr.c @ 6:3c36bc28c6c2
more stuff in the vr test
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 21 Aug 2014 01:08:03 +0300 |
parents | e6948e131526 |
children | bd8202d6d28d |
line diff
1.1 --- a/src/vr/vr.c Wed Aug 20 16:34:43 2014 +0300 1.2 +++ b/src/vr/vr.c Thu Aug 21 01:08:03 2014 +0300 1.3 @@ -108,17 +108,25 @@ 1.4 return 0; 1.5 } 1.6 1.7 -void vr_present(unsigned int fbtex) 1.8 +void vr_begin(int eye) 1.9 { 1.10 - if(vrm && vrm->draw) { 1.11 - vrm->draw(fbtex, fbtex_rect[0], fbtex_rect[2], fbtex_rect[1], fbtex_rect[3]); 1.12 + if(vrm && vrm->begin) { 1.13 + vrm->begin(eye); 1.14 } 1.15 } 1.16 1.17 -void vr_fbrect(float u, float umax, float v, float vmax) 1.18 +void vr_end(void) 1.19 { 1.20 - fbtex_rect[0] = u; 1.21 - fbtex_rect[1] = v; 1.22 - fbtex_rect[2] = umax; 1.23 - fbtex_rect[3] = vmax; 1.24 + if(vrm && vrm->end) { 1.25 + vrm->end(); 1.26 + } 1.27 } 1.28 + 1.29 +int vr_swap_buffers(void) 1.30 +{ 1.31 + if(vrm && vrm->present) { 1.32 + vrm->present(); 1.33 + return 1; 1.34 + } 1.35 + return 0; 1.36 +}