aboutsummaryrefslogtreecommitdiff
path: root/tests/hello_world_gles.c
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-05 12:16:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-05 12:16:32 -0700
commit270e442e15d3327534ee8e6dc8285c9873babb84 (patch)
treeb3989b71dfd85b3e095d8f87b7fece530f98db94 /tests/hello_world_gles.c
parent8019523bafc3f527a39243034c0ed32a4f2b4918 (diff)
parente9dc897fb280a9150b7b42ac4999d70c0809c33d (diff)
Merge pull request #354 from behdad/fix-keyboard
More GLUT fixes
Diffstat (limited to 'tests/hello_world_gles.c')
-rw-r--r--tests/hello_world_gles.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/hello_world_gles.c b/tests/hello_world_gles.c
index 4f2cb45c..088b9dae 100644
--- a/tests/hello_world_gles.c
+++ b/tests/hello_world_gles.c
@@ -46,17 +46,27 @@
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#include <Glut/glut.h>
+#else
#include <GL/gl.h>
#include <GL/glut.h>
-
-#ifndef HAVE_BUILTIN_SINCOS
-#include "sincos.h"
#endif
#define STRIPS_PER_TOOTH 7
#define VERTICES_PER_TOOTH 34
#define GEAR_VERTEX_STRIDE 6
+#ifndef HAVE_BUILTIN_SINCOS
+static void
+sincos (double a, double *s, double *c)
+{
+ *s = sin (a);
+ *c = cos (a);
+}
+#endif
+
/**
* Struct describing the vertices in triangle strip
*/
@@ -715,7 +725,7 @@ main(int argc, char *argv[])
glutCreateWindow("es2gears");
/* Set up glut callback functions */
- gears_idle();
+ glutIdleFunc (gears_idle);
glutReshapeFunc(gears_reshape);
glutDisplayFunc(gears_draw);
glutSpecialFunc(gears_special);