Commit 938376b3 authored by Robert Menzel's avatar Robert Menzel

added andoid includes

parent e4615c1f
......@@ -38,48 +38,15 @@
* (full/compatibility profile).
*/
// To compare the OpenGL version number we define a new ACGL_OPENGL_VERSION XY define here
// analog to ACGL_OPENGL_VERSION_XY
#if defined (ACGL_OPENGL_VERSION_21)
# define ACGL_OPENGL_VERSION 21
#elif defined (ACGL_OPENGL_VERSION_30)
# define ACGL_OPENGL_VERSION 30
#elif defined (ACGL_OPENGL_VERSION_31)
# define ACGL_OPENGL_VERSION 31
#elif defined (ACGL_OPENGL_VERSION_32)
# define ACGL_OPENGL_VERSION 32
#elif defined (ACGL_OPENGL_VERSION_33)
# define ACGL_OPENGL_VERSION 33
#elif defined (ACGL_OPENGL_VERSION_40)
# define ACGL_OPENGL_VERSION 40
#elif defined (ACGL_OPENGL_VERSION_41)
# define ACGL_OPENGL_VERSION 41
#elif defined (ACGL_OPENGL_VERSION_42)
# define ACGL_OPENGL_VERSION 42
#elif defined (ACGL_OPENGL_VERSION_43)
# define ACGL_OPENGL_VERSION 43
#else
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL)
#define ACGL_OPENGL_VERSION_43
#define ACGL_OPENGL_VERSION 43
#define ACGL_OPENGL_PROFILE_FULL
#else
// fallback:
#warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2 core (but load all available functions)"
// *we* only assume OpenGL 3.2 core...
#define ACGL_OPENGL_VERSION_32
#define ACGL_OPENGL_VERSION 32
#define ACGL_OPENGL_PROFILE_CORE
// ... but include the latest header and try to load all function in case the app needs more:
// (only if the internal loader gets used, but GLEW will also try to load everything)
#define ACGL_OPENGL_INCLUDE_LATEST_GL
#endif // latest GL
#endif // version checks
// Android:
#ifdef __ANDROID__
# define ACGL_OPENGL_ES
# define PLATFORM_ANDROID
#endif
// If we're compiling for an Apple system we need this to distinquish between Mac and iOS:
#ifdef __APPLE__
#include <TargetConditionals.h>
# include <TargetConditionals.h>
#endif
#if (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
......@@ -87,16 +54,66 @@
# define PLATFORM_IOS
# define ACGL_OPENGL_ES
# endif
#else
// no iOS device...
# ifdef ACGL_PLATFORM_MOBILE
// ...but mobile:
// maybe maemo or android: first one to program for these plattforms should add
// the correct includes here!
# define ACGL_OPENGL_ES
# endif
#endif
//manually enforced ES:
#ifdef ACGL_PLATFORM_MOBILE
// ...but mobile:
// maybe maemo or android: first one to program for these plattforms should add
// the correct includes here!
# define ACGL_OPENGL_ES
#endif
// To compare the OpenGL version number we define a new ACGL_OPENGL_VERSION XY define here
// analog to ACGL_OPENGL_VERSION_XY
// OpenGL ES 2.0 is the default for embedded:
#ifdef ACGL_OPENGL_ES
# if defined (ACGL_OPENGLES_VERSION_30)
# define ACGL_OPENGLES_VERSION 30
# else
# define ACGL_OPENGLES_VERSION_20
# define ACGL_OPENGLES_VERSION 20
# endif
#else
// Desktop:
#if defined (ACGL_OPENGL_VERSION_21)
# define ACGL_OPENGL_VERSION 21
#elif defined (ACGL_OPENGL_VERSION_30)
# define ACGL_OPENGL_VERSION 30
#elif defined (ACGL_OPENGL_VERSION_31)
# define ACGL_OPENGL_VERSION 31
#elif defined (ACGL_OPENGL_VERSION_32)
# define ACGL_OPENGL_VERSION 32
#elif defined (ACGL_OPENGL_VERSION_33)
# define ACGL_OPENGL_VERSION 33
#elif defined (ACGL_OPENGL_VERSION_40)
# define ACGL_OPENGL_VERSION 40
#elif defined (ACGL_OPENGL_VERSION_41)
# define ACGL_OPENGL_VERSION 41
#elif defined (ACGL_OPENGL_VERSION_42)
# define ACGL_OPENGL_VERSION 42
#elif defined (ACGL_OPENGL_VERSION_43)
# define ACGL_OPENGL_VERSION 43
#else
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL)
#define ACGL_OPENGL_VERSION_43
#define ACGL_OPENGL_VERSION 43
#define ACGL_OPENGL_PROFILE_FULL
#else
// fallback:
#warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2 core (but load all available functions)"
// *we* only assume OpenGL 3.2 core...
#define ACGL_OPENGL_VERSION_32
#define ACGL_OPENGL_VERSION 32
#define ACGL_OPENGL_PROFILE_CORE
// ... but include the latest header and try to load all function in case the app needs more:
// (only if the internal loader gets used, but GLEW will also try to load everything)
#define ACGL_OPENGL_INCLUDE_LATEST_GL
#endif // latest GL
#endif // version checks
#endif // OpenGL ES
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
......@@ -106,14 +123,28 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef ACGL_OPENGL_ES
#if (defined(__APPLE__) || defined(MACOSX))
#if (PLATFORM_IOS)
//iOS:
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#if defined (ACGL_OPENGLES_VERSION_20)
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#else
#error "location of ES 3 headers not known"
#endif
#elif defined (PLATFORM_ANDROID)
// Android:
#if defined (ACGL_OPENGLES_VERSION_20)
//#include <GLES/gl.h>
//#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
#endif
#else
// Android et al.:
#error "UNKNOWN mobile plattform! Don't know what to include!"
#endif
#else // ACGL_OPENGL_ES
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment