Copy documentation about FREEGLUT_GLES2 and FREEGLUT_GLES1 from CMakefile.txt to...
[freeglut] / include / GL / freeglut_std.h
index 768157f..799987e 100644 (file)
@@ -43,7 +43,7 @@
  */
 
 /* Define FREEGLUT_LIB_PRAGMAS to 1 to include library
- * pragmas or to 1 to exclude library pragmas.
+ * pragmas or to 0 to exclude library pragmas.
  * The default behavior depends on the compiler/platform.
  */
 #   ifndef FREEGLUT_LIB_PRAGMAS
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN 1
 #  endif
-#   define NOMINMAX
-#   include <Windows.h>
+#  ifndef NOMINMAX
+#    define NOMINMAX
+#  endif
+#   include <windows.h>
 
 /* Windows static library */
 #   ifdef FREEGLUT_STATIC
 /*
  * Always include OpenGL and GLU headers
  */
-#include <GL/gl.h>
-#include <GL/glu.h>
+/* Note: FREEGLUT_GLES1 and FREEGLUT_GLES2 are only used to cleanly
+   bootstrap headers inclusion here; use GLES constants directly
+   (e.g. GL_ES_VERSION_2_0) for all other needs */
+#ifdef FREEGLUT_GLES2
+#   include <EGL/egl.h>
+#   include <GLES2/gl2.h>
+#elif FREEGLUT_GLES1
+#   include <EGL/egl.h>
+#   include <GLES/gl.h>
+#else
+#   include <GL/gl.h>
+#   include <GL/glu.h>
+#endif
 
 /*
  * GLUT API macro definitions -- the special key codes:
 #define  GLUT_MULTISAMPLE                   0x0080
 #define  GLUT_STEREO                        0x0100
 #define  GLUT_LUMINANCE                     0x0200
-#define  GLUT_CAPTIONLESS                   0x0400
-#define  GLUT_BORDERLESS                    0x0800
 
 /*
  * GLUT API macro definitions -- windows and menu related definitions
@@ -513,6 +524,11 @@ FGAPI int     FGAPIENTRY glutStrokeLength( void* font, const unsigned char* stri
 /*
  * Geometry functions, see freeglut_geometry.c
  */
+#ifdef EGL_VERSION_1_0
+/* TODO: temporary work-around for missing GLdouble in GLES */
+#   define GLdouble     GLfloat  
+#endif
+
 FGAPI void    FGAPIENTRY glutWireCube( GLdouble size );
 FGAPI void    FGAPIENTRY glutSolidCube( GLdouble size );
 FGAPI void    FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks );
@@ -599,7 +615,7 @@ FGAPI void    FGAPIENTRY glutReportErrors( void );
 /* to get the prototype for exit() */
 #include <stdlib.h>
 
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__)
 FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
 FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
 FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));