/*
* Always include OpenGL and GLU headers
*/
+#ifdef ANDROID
+/* Use EGL (implies OpenGL ES) */
+/* TODO: EGL/GLES builds should be more generally defined, possibly by
+ generating this file dynamically */
+#include <EGL/egl.h>
+/* TODO: we probably need 2 builds: -lGLESv1 and -lGLESv2 */
+/* #include <GLES/gl.h> */
+#include <GLES2/gl2.h>
+/* TODO: temporary work-around for e.g. glutWireCube */
+#define GLdouble GLfloat
+#else
#include <GL/gl.h>
#include <GL/glu.h>
+#endif
/*
* GLUT API macro definitions -- the special key codes:
|| ( defined(__CYGWIN__) && defined(X_DISPLAY_MISSING) )
# define TARGET_HOST_MS_WINDOWS 1
+#elif defined (ANDROID)
+# define TARGET_HOST_ANDROID 1
+
#elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun)
# define TARGET_HOST_POSIX_X11 1
#if TARGET_HOST_MS_WINDOWS
#include "../mswin/freeglut_internal_mswin.h"
#endif
+#if TARGET_HOST_ANDROID
+#include "../android/freeglut_internal_android.h"
+#endif
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
case GL_INVALID_ENUM: return "invalid enumerant";
case GL_INVALID_VALUE: return "invalid value";
case GL_INVALID_OPERATION: return "invalid operation";
+#ifndef GL_ES_VERSION_2_0
case GL_STACK_OVERFLOW: return "stack overflow";
case GL_STACK_UNDERFLOW: return "stack underflow";
+#endif
case GL_OUT_OF_MEMORY: return "out of memory";
case GL_TABLE_TOO_LARGE: return "table too large";
case GL_INVALID_FRAMEBUFFER_OPERATION: return "invalid framebuffer operation";
window->Window.DoubleBuffered =
( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0;
+#ifndef EGL_VERSION_1_0 /* No glDrawBuffer/glReadBuffer in GLES */
if ( ! window->Window.DoubleBuffered )
{
glDrawBuffer ( GL_FRONT );
glReadBuffer ( GL_FRONT );
}
+#endif
}
/*