aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-19 16:48:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-19 16:48:32 -0700
commitbfc6f99f7d09eca06470999ceac9cb6611223dec (patch)
treea46290977669362cb83fd0d183a30faaf4c69417
parentc5674220e9f893c4394af5aa86866301d3d12ef6 (diff)
add single-color immediate mode test (with wrong color, but better than nothing)
-rw-r--r--src/library_gl.js1
-rwxr-xr-xtests/runner.py2
-rw-r--r--tests/screenshot-gray-purple.pngbin0 -> 203952 bytes
-rw-r--r--tests/sdl_ogl.c11
4 files changed, 6 insertions, 8 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 2bac6eab..c7a733d4 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1341,7 +1341,6 @@ var LibraryGL = {
GL.immediate.vertexData[GL.immediate.vertexCounter++] = z || 0;
#if ASSERTIONS
assert(GL.immediate.vertexCounter < GL.immediate.maxElements);
- assert(GL.immediate.vertexCounter % 5 == 0);
#endif
GL.immediate.addRendererComponent('V3');
},
diff --git a/tests/runner.py b/tests/runner.py
index ecda863e..a0f46681 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7093,7 +7093,7 @@ elif 'browser' in str(sys.argv):
def test_sdl_ogl(self):
# SDL, OpenGL, textures, immediate mode
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'))
+ self.reftest(path_from_root('tests', 'screenshot-gray-purple.png'))
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')
diff --git a/tests/screenshot-gray-purple.png b/tests/screenshot-gray-purple.png
new file mode 100644
index 00000000..13881779
--- /dev/null
+++ b/tests/screenshot-gray-purple.png
Binary files differ
diff --git a/tests/sdl_ogl.c b/tests/sdl_ogl.c
index 32260f91..4258a663 100644
--- a/tests/sdl_ogl.c
+++ b/tests/sdl_ogl.c
@@ -138,16 +138,15 @@ int main(int argc, char *argv[])
glTexCoord2i( 1, 1 ); glVertex3f( 300, 400, 0 );
glTexCoord2i( 0, 1 ); glVertex3f( 500, 410, 0 );
glEnd();
-/*
+
glDisable(GL_TEXTURE_2D);
glBegin( GL_QUADS );
- glVertex3f( 10, 10, 0 );
- glVertex3f( 300, 10, 0 );
- glVertex3f( 300, 128, 0 );
- glVertex3f( 10, 128, 0 );
+ glVertex3f( 10, 410, 0 );
+ glVertex3f( 300, 410, 0 );
+ glVertex3f( 300, 480, 0 );
+ glVertex3f( 10, 470, 0 );
glEnd();
-*/
SDL_GL_SwapBuffers();