aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-23 20:41:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-23 20:41:48 -0700
commita32ac16a6c65d4a51354255c8b98e1c95faf2fc6 (patch)
treee03922066ec1278fc19ab8efac0616d40f2e18ec
parent41bc8a9c147354b079f842924f25f40e50a25b1b (diff)
clean up cubegeom
-rw-r--r--tests/cubegeom.c15
-rwxr-xr-xtests/runner.py9
2 files changed, 13 insertions, 11 deletions
diff --git a/tests/cubegeom.c b/tests/cubegeom.c
index b82a08af..1fb5eeef 100644
--- a/tests/cubegeom.c
+++ b/tests/cubegeom.c
@@ -13,11 +13,15 @@ REDISTRIBUTION OF THIS SOFTWARE.
*/
#if !EMSCRIPTEN
+#define USE_GLEW 1
+#endif
+
+#if USE_GLEW
#include "GL/glew.h"
#endif
#include "SDL/SDL.h"
-#if EMSCRIPTEN
+#if !USE_GLEW
#include "SDL/SDL_opengl.h"
#endif
@@ -75,13 +79,14 @@ int main(int argc, char *argv[])
// BEGIN
-#if !EMSCRIPTEN
+#if USE_GLEW
glewInit();
#endif
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glFrustum(-0.6435469817188064, 0.6435469817188064 ,-0.48266022190470925, 0.48266022190470925 ,0.5400000214576721, 2048);
+ // original: glFrustum(-0.6435469817188064, 0.6435469817188064 ,-0.48266022190470925, 0.48266022190470925 ,0.5400000214576721, 2048);
+ glFrustum(-0.6435469817188064, 0.1435469817188064 ,-0.48266022190470925, 0.88266022190470925 ,0.5400000214576721, 2048);
glMatrixMode(GL_MODELVIEW);
GLfloat matrixData[] = { -1, 0, 0, 0,
0, 0,-1, 0,
@@ -199,8 +204,8 @@ int main(int argc, char *argv[])
"void main(void)\n"
"{\n"
" gl_Position = ftransform();\n"
- " gl_TexCoord[0].xy = gl_MultiTexCoord0.xy + texgenscroll.xy;\n"
- " gl_TexCoord[1].xy = gl_MultiTexCoord1.xy * 3.051851e-05;\n"
+ " gl_TexCoord[0].xy = gl_MultiTexCoord0.xy/100 + texgenscroll.xy;\n" // added /100 here
+ " gl_TexCoord[1].xy = gl_MultiTexCoord1.xy/100 * 3.051851e-05;\n"
"}\n";
const char *fragmentShader = "uniform vec4 colorparams;\n"
"uniform sampler2D diffusemap, lightmap;\n"
diff --git a/tests/runner.py b/tests/runner.py
index 0d6df070..0e1b4716 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7127,12 +7127,6 @@ elif 'browser' in str(sys.argv):
Popen(['python', EMCC, path_from_root('tests', 'sdl_ogl_p.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_cubegeom(self):
- 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'))
- Popen(['python', EMCC, path_from_root('tests', 'cubegeom.c'), '-o', 'something.html', '--pre-js', 'reftest.js', '--preload-file', 'screenshot.png']).communicate()
- self.run_browser('something.html', '', '/report_result?0')
-
def test_worker(self):
# Test running in a web worker
output = Popen(['python', EMCC, path_from_root('tests', 'hello_world_worker.cpp'), '-o', 'worker.js'], stdout=PIPE, stderr=PIPE).communicate()
@@ -7230,6 +7224,9 @@ elif 'browser' in str(sys.argv):
def test_sdlglshader(self):
self.btest('sdlglshader.c', reference='sdlglshader.png')
+ def zzztest_cubegeom(self):
+ self.btest('cubegeom.c', reference='sdlglshader.png')
+
elif 'benchmark' in str(sys.argv):
# Benchmarks. Run them with argument |benchmark|. To run a specific test, do
# |benchmark.test_X|.