istereo
changeset 13:fe1cb1c567cc
at long last
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 07 Sep 2011 08:33:55 +0300 |
parents | 9890940948f7 |
children | b39d8607f4bb |
files | sdr/test.v.glsl src/ES2Renderer.m src/istereo.c |
diffstat | 3 files changed, 9 insertions(+), 16 deletions(-) [+] |
line diff
1.1 --- a/sdr/test.v.glsl Wed Sep 07 08:30:24 2011 +0300 1.2 +++ b/sdr/test.v.glsl Wed Sep 07 08:33:55 2011 +0300 1.3 @@ -1,4 +1,4 @@ 1.4 -//uniform mat4 matrix_modelview, matrix_projection; 1.5 +uniform mat4 matrix_modelview, matrix_projection; 1.6 1.7 attribute vec4 attr_vertex, attr_color; 1.8 1.9 @@ -6,7 +6,7 @@ 1.10 1.11 void main() 1.12 { 1.13 - //mat4 mvp = matrix_projection * matrix_modelview; 1.14 - gl_Position = /*mvp */ attr_vertex; 1.15 + mat4 mvp = matrix_projection * matrix_modelview; 1.16 + gl_Position = mvp * attr_vertex; 1.17 var_color = attr_color; 1.18 }
2.1 --- a/src/ES2Renderer.m Wed Sep 07 08:30:24 2011 +0300 2.2 +++ b/src/ES2Renderer.m Wed Sep 07 08:33:55 2011 +0300 2.3 @@ -56,7 +56,7 @@ 2.4 return NO; 2.5 } 2.6 2.7 - reshape(0, 0, backingWidth, backingHeight); 2.8 + reshape(backingWidth, backingHeight); 2.9 2.10 return YES; 2.11 }
3.1 --- a/src/istereo.c Wed Sep 07 08:30:24 2011 +0300 3.2 +++ b/src/istereo.c Wed Sep 07 08:33:55 2011 +0300 3.3 @@ -35,13 +35,13 @@ 3.4 3.5 bind_program(prog); 3.6 3.7 - /*gl_matrix_mode(GL_MODELVIEW); 3.8 + gl_matrix_mode(GL_MODELVIEW); 3.9 gl_load_identity(); 3.10 - gl_translatef(0, 0, -8);*/ 3.11 + gl_translatef(0, 0, -8); 3.12 3.13 - dbg_draw(); 3.14 + //dbg_draw(); 3.15 3.16 - /*gl_begin(GL_QUADS); 3.17 + gl_begin(GL_QUADS); 3.18 gl_color3f(1, 0, 0); 3.19 gl_vertex3f(-1, -1, 0); 3.20 gl_color3f(0, 1, 0); 3.21 @@ -50,7 +50,7 @@ 3.22 gl_vertex3f(1, 1, 0); 3.23 gl_color3f(1, 1, 0); 3.24 gl_vertex3f(-1, 1, 0); 3.25 - gl_end();*/ 3.26 + gl_end(); 3.27 3.28 assert(glGetError() == GL_NO_ERROR); 3.29 } 3.30 @@ -78,13 +78,6 @@ 3.31 if(!(prog = create_program_link(vs, ps))) { 3.32 return -1; 3.33 } 3.34 - 3.35 - glBindAttribLocation(prog, 0, "attr_vertex"); 3.36 - glBindAttribLocation(prog, 1, "attr_color"); 3.37 - glLinkProgram(prog); 3.38 - 3.39 - assert(prog); 3.40 - 3.41 return prog; 3.42 } 3.43