oculus2_psprite

changeset 16:0888d4e24e21

merged
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 29 Oct 2014 01:09:33 +0200
parents 62a37bd5bc74 8a80bb153582
children 5558b43eb653
files src/main.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/src/main.c	Wed Oct 29 01:08:38 2014 +0200
     1.2 +++ b/src/main.c	Wed Oct 29 01:09:33 2014 +0200
     1.3 @@ -11,8 +11,6 @@
     1.4  #include <assert.h>
     1.5  #include <SDL2/SDL.h>
     1.6  #include <GL/glew.h>
     1.7 -#include <X11/Xlib.h>
     1.8 -#include <GL/glx.h>
     1.9  
    1.10  #ifdef WIN32
    1.11  #define OVR_OS_WIN32
    1.12 @@ -20,6 +18,8 @@
    1.13  #define OVR_OS_MAC
    1.14  #else
    1.15  #define OVR_OS_LINUX
    1.16 +#include <X11/Xlib.h>
    1.17 +#include <GL/glx.h>
    1.18  #endif
    1.19  
    1.20  #include <OVR_CAPI.h>
    1.21 @@ -380,11 +380,19 @@
    1.22  		draw_box(0.5, 0.5, 0.5, 1.0);
    1.23  		glPopMatrix();
    1.24  	}
    1.25 +
    1.26 +	col[0] = 1;
    1.27 +	col[1] = 1;
    1.28 +	col[2] = 0.4;
    1.29 +	glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, col);
    1.30 +	draw_box(0.05, 1.2, 6, 1.0);
    1.31 +	draw_box(6, 1.2, 0.05, 1.0);
    1.32  }
    1.33  
    1.34  void draw_box(float xsz, float ysz, float zsz, float norm_sign)
    1.35  {
    1.36  	glMatrixMode(GL_MODELVIEW);
    1.37 +	glPushMatrix();
    1.38  	glScalef(xsz * 0.5, ysz * 0.5, zsz * 0.5);
    1.39  
    1.40  	if(norm_sign < 0.0) {
    1.41 @@ -433,6 +441,7 @@
    1.42  	glEnd();
    1.43  
    1.44  	glFrontFace(GL_CCW);
    1.45 +	glPopMatrix();
    1.46  }
    1.47  
    1.48  /* update_rtarg creates (and/or resizes) the render target used to draw the two stero views */