libgoatvr

diff example/src/main.c @ 8:3d9ec6fe97d7

- added distortion mesh generation for the OpenHMD module (unfinished) - changed internal implementation function naming to use the vrimp_ prefix - added an opengl helper function to load extension entry points
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 13:22:53 +0300
parents b71314e80654
children 34d4643d61f9
line diff
     1.1 --- a/example/src/main.c	Fri Sep 19 15:16:51 2014 +0300
     1.2 +++ b/example/src/main.c	Sat Sep 20 13:22:53 2014 +0300
     1.3 @@ -139,8 +139,8 @@
     1.4  void display(void)
     1.5  {
     1.6  	int i;
     1.7 -	float proj_mat[16];
     1.8 -	float rot_mat[16], view_mat[16];
     1.9 +	float proj_mat[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
    1.10 +	float view_mat[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
    1.11  
    1.12  	/* start drawing onto our texture render target */
    1.13  	glBindFramebuffer(GL_FRAMEBUFFER, fbo);
    1.14 @@ -164,7 +164,7 @@
    1.15  		 * use glLoadTransposeMatrixf instead of glLoadMatrixf to load it.
    1.16  		 */
    1.17  		if(vr_proj_matrix(i, 0.5, 500.0, proj_mat)) {
    1.18 -			glLoadTransposeMatrixf(proj_mat);
    1.19 +			glLoadMatrixf(proj_mat);
    1.20  		} else {
    1.21  			glLoadIdentity();
    1.22  			gluPerspective(50.0, (float)fb_width / 2.0 / (float)fb_height, 0.5, 500.0);
    1.23 @@ -176,7 +176,7 @@
    1.24  		 */
    1.25  		glMatrixMode(GL_MODELVIEW);
    1.26  		vr_view_matrix(i, view_mat);
    1.27 -		glLoadTransposeMatrixf(view_mat);
    1.28 +		glLoadMatrixf(view_mat);
    1.29  		/* move the camera to the eye level of the user */
    1.30  		glTranslatef(0, -vr_get_optf(VR_OPT_EYE_HEIGHT), 0);
    1.31