diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-04 14:54:42 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-04 14:54:42 -0700 |
commit | d2a3ea8ca82533ac4dae07605aa56dee8bee9558 (patch) | |
tree | d7ad8fb4535cd9a4bb98053ec49c5bb9e8a8fbe9 /tests | |
parent | fb96dbf7e0599e8052bd315f3f8e41d448e66449 (diff) |
handle glBufferData usages that are not in WebGL; fixes #1589
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gl_vertex_buffer.c | 9 | ||||
-rw-r--r-- | tests/test_browser.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/gl_vertex_buffer.c b/tests/gl_vertex_buffer.c index 931db618..6b695462 100644 --- a/tests/gl_vertex_buffer.c +++ b/tests/gl_vertex_buffer.c @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) // bind to it glBindBuffer(GL_ARRAY_BUFFER, vbo); // send it to gl - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices2), vertices2, GL_STATIC_READ); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertices2), vertices2, GL_STATIC_READ); // GL_STATIC_READ is not in WebGL! // unbind from it glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); - // TEST 1 + // TEST 1 - clientside data glVertexPointer(2, GL_FLOAT, sizeof(Vertex), vertices); glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), &vertices[0].color); @@ -166,9 +166,8 @@ int main(int argc, char *argv[]) - // TEST 2 + // TEST 2 - bind to array buffer, gl*Pointer calls are offsets into the buffer, which was previously uploaded to -// bind to it again glBindBuffer(GL_ARRAY_BUFFER, vbo); glVertexPointer(2, GL_FLOAT, sizeof(Vertex), 0); @@ -187,7 +186,7 @@ int main(int argc, char *argv[]) #if !EMSCRIPTEN // Wait for 3 seconds to give us a chance to see the image - SDL_Delay(6000); + SDL_Delay(3000); #endif SDL_Quit(); diff --git a/tests/test_browser.py b/tests/test_browser.py index 10b048a0..3ac640f1 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -1211,7 +1211,7 @@ If manually bisecting: self.btest('gl_vertex_buffer_pre.c', reference='gl_vertex_buffer_pre.png', args=['-s', 'GL_UNSAFE_OPTS=0', '-s', 'LEGACY_GL_EMULATION=1']) def test_gl_vertex_buffer(self): - self.btest('gl_vertex_buffer.c', reference='gl_vertex_buffer.png', args=['-s', 'GL_UNSAFE_OPTS=0', '-s', 'LEGACY_GL_EMULATION=1']) + self.btest('gl_vertex_buffer.c', reference='gl_vertex_buffer.png', args=['-s', 'GL_UNSAFE_OPTS=0', '-s', 'LEGACY_GL_EMULATION=1'], reference_slack=1) def test_matrix_identity(self): self.btest('gl_matrix_identity.c', expected=['-1882984448', '460451840'], args=['-s', 'LEGACY_GL_EMULATION=1']) |