-// Define USE_OPENGL_ES to the GL ES Version you want to select
-#ifndef USE_OPENGL_ES
-# define USE_OPENGL_ES 0
-#endif
-
-#if !defined (__APPLE__)
+/* Change USE_OPENGL_ES value to set the OpenGL ES version (1, 2) you want to use
+ * A value of 0 will activate normal OpenGL */
+#ifdef __APPLE__
+# include <TargetConditionals.h>
+# if !TARGET_OS_IPHONE
+# define USE_OPENGL_ES 0
+# define MACOS_OPENGL
+# include <OpenGL/gl.h>
+# else /* Force ESv2 on iOS */
+# define USE_OPENGL_ES 2
+# include <OpenGLES/ES1/gl.h>
+# include <OpenGLES/ES2/gl.h>
+# include <OpenGLES/ES2/glext.h>
+# endif
+#else /* !defined (__APPLE__) */
+# ifndef USE_OPENGL_ES
+# define USE_OPENGL_ES 0
+# endif