diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-15 21:12:05 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-15 21:12:05 -0700 |
commit | c24e5c28dbc5014d26f03dc6247b62684eba88f5 (patch) | |
tree | 68396b53e5ae08879f61e8afe4dc318f2ea2068b /src/library_gl.js | |
parent | b583faa646eb0e80ac0c07c8a221938e96aea297 (diff) |
add working test_sdl_ogl_p
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index e7cf914d..34511bcb 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1010,6 +1010,7 @@ var LibraryGL = { vertexSize: vertexSize, init: function() { this.vertexShader = Module.ctx.createShader(Module.ctx.VERTEX_SHADER); + var zero = positionSize == 2 ? '0, ' : ''; Module.ctx.shaderSource(this.vertexShader, 'attribute vec' + positionSize + ' a_position; \n\ attribute vec2 a_texCoord; \n\ varying vec2 v_texCoord; \n\ @@ -1017,7 +1018,7 @@ var LibraryGL = { uniform mat4 u_projection; \n\ void main() \n\ { \n\ - gl_Position = u_projection * (u_modelView * vec4(a_position, 1.0)); \n\ + gl_Position = u_projection * (u_modelView * vec4(a_position, ' + zero + '1.0)); \n\ v_texCoord = a_texCoord; \n\ } \n'); Module.ctx.compileShader(this.vertexShader); |