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 | |
parent | b583faa646eb0e80ac0c07c8a221938e96aea297 (diff) |
add working test_sdl_ogl_p
-rw-r--r-- | src/library_gl.js | 3 | ||||
-rwxr-xr-x | tests/runner.py | 2 |
2 files changed, 3 insertions, 2 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); diff --git a/tests/runner.py b/tests/runner.py index 63933888..58118127 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7049,7 +7049,7 @@ elif 'browser' in str(sys.argv): Popen(['python', EMCC, path_from_root('tests', 'sdl_ogl.c'), '-o', 'something.html', '--pre-js', 'reftest.js', '--preload-file', 'screenshot.png']).communicate() self.run_browser('something.html', 'You should see an image with gray at the top.', '/report_result?0') - def zzztest_sdl_ogl_p(self): + def test_sdl_ogl_p(self): # Immediate mode with pointers shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png')) self.reftest(path_from_root('tests', 'screenshot-gray.png')) |