vrchess

diff src/game.cc @ 9:c2eecf764daa

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 22 Aug 2014 18:48:25 +0300
parents 90abf4b93cc9
children 5dc4e2b8f6f5
line diff
     1.1 --- a/src/game.cc	Fri Aug 22 17:24:43 2014 +0300
     1.2 +++ b/src/game.cc	Fri Aug 22 18:48:25 2014 +0300
     1.3 @@ -22,7 +22,6 @@
     1.4  bool game_init()
     1.5  {
     1.6  	vr_init();
     1.7 -	vr_use_module_named("null");
     1.8  
     1.9  	glEnable(GL_DEPTH_TEST);
    1.10  	glEnable(GL_CULL_FACE);
    1.11 @@ -106,6 +105,8 @@
    1.12  
    1.13  	vr_output_texture(rtarg->get_texture_id(), 0, 0, (float)rtwidth / (float)rtarg->get_width(),
    1.14  		(float)rtheight / (float)rtarg->get_height());
    1.15 +
    1.16 +	vr_swap_buffers();
    1.17  }
    1.18  
    1.19  static void game_render_eye(int eye)
    1.20 @@ -122,11 +123,11 @@
    1.21  	}*/
    1.22  
    1.23  	glMatrixMode(GL_MODELVIEW);
    1.24 -	if(eye == 0 || !vr_view_matrix(eye < 0 ? 0 : 1, mat)) {
    1.25 +	//if(eye == 0 || !vr_view_matrix(eye < 0 ? 0 : 1, mat)) {
    1.26  		glLoadIdentity();
    1.27 -	} else {
    1.28 +	/*} else {
    1.29  		glLoadTransposeMatrixf(mat);
    1.30 -	}
    1.31 +	}*/
    1.32  	glMultTransposeMatrixf(view_matrix[0]);
    1.33  
    1.34  	draw_scene();
    1.35 @@ -160,6 +161,10 @@
    1.36  		switch(key) {
    1.37  		case 27:
    1.38  			exit(0);
    1.39 +
    1.40 +		case ' ':
    1.41 +			vr_recenter();
    1.42 +			break;
    1.43  		}
    1.44  	}
    1.45