aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-23 17:50:11 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-23 17:50:11 -0700
commit4d70c93726bdbc99bfc41e651c23dc1deba9009b (patch)
tree7d4f40160fdc9109fb93f05dbe27c33820dfb543
parent3fca3a54c8df9f36d0638e7392fa015664cee789 (diff)
make cubegeom build both natively and with emscripten
-rw-r--r--tests/cubegeom.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/cubegeom.c b/tests/cubegeom.c
index 94487c77..b82a08af 100644
--- a/tests/cubegeom.c
+++ b/tests/cubegeom.c
@@ -12,9 +12,14 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
+#if !EMSCRIPTEN
#include "GL/glew.h"
+#endif
#include "SDL/SDL.h"
+#if EMSCRIPTEN
+#include "SDL/SDL_opengl.h"
+#endif
#include <stdio.h>
#include <string.h>
@@ -29,7 +34,7 @@ int main(int argc, char *argv[])
}
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
- screen = SDL_SetVideoMode( 1024, 768, 24, SDL_OPENGL );
+ screen = SDL_SetVideoMode( 640, 480, 24, SDL_OPENGL );
if ( !screen ) {
printf("Unable to set video mode: %s\n", SDL_GetError());
return 1;
@@ -70,7 +75,9 @@ int main(int argc, char *argv[])
// BEGIN
+#if !EMSCRIPTEN
glewInit();
+#endif
glMatrixMode(GL_PROJECTION);
glLoadIdentity();