diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 6 | ||||
-rw-r--r-- | tests/screenshot-gray.png | bin | 0 -> 170477 bytes | |||
-rw-r--r-- | tests/sdl_ogl.c | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index 099cd609..7c24c799 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7009,12 +7009,12 @@ elif 'browser' in str(sys.argv): Popen(['python', EMCC, os.path.join(self.get_dir(), 'sdl_gl_read.c'), '-o', 'something.html']).communicate() self.run_browser('something.html', '.', '/report_result?1') - def zzztest_sdl_ogl(self): + 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', 'gears.png')) + self.reftest(path_from_root('tests', 'screenshot-gray.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 animating gears.', '/report_result?1779') + self.run_browser('something.html', 'You should see an image with gray at the top.', '/report_result?0') def test_worker(self): # Test running in a web worker diff --git a/tests/screenshot-gray.png b/tests/screenshot-gray.png Binary files differnew file mode 100644 index 00000000..928f9f9a --- /dev/null +++ b/tests/screenshot-gray.png diff --git a/tests/sdl_ogl.c b/tests/sdl_ogl.c index 6884f478..cec32bf1 100644 --- a/tests/sdl_ogl.c +++ b/tests/sdl_ogl.c @@ -90,12 +90,16 @@ int main(int argc, char *argv[]) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + SDL_LockSurface(surface); + // Add some greyness memset(surface->pixels, 0x66, surface->w*surface->h); - + // Edit the texture object's image data using the information SDL_Surface gives us glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, surface->w, surface->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels ); + + SDL_UnlockSurface(surface); } else { printf("SDL could not load image.bmp: %s\n", SDL_GetError()); |