7 #if defined (EEGEO_DROID)
8 #define GL_GLEXT_PROTOTYPES
10 #include <GLES2/gl2.h>
11 #include <GLES2/gl2ext.h>
12 #elif defined (EEGEO_IOS)
13 #include <OpenGLES/ES1/gl.h>
14 #include <OpenGLES/ES1/glext.h>
15 #include <OpenGLES/ES2/gl.h>
16 #include <OpenGLES/ES2/glext.h>
17 #elif defined (EEGEO_OSX)
18 #include <OpenGL/gl.h>
19 #include <OpenGL/glu.h>
20 #elif defined (EMSCRIPTEN)
22 #include <GLES2/gl2.h>
23 #include <GLES2/gl2ext.h>
24 #include <emscripten.h>
25 #elif defined (EEGEO_WIN)
26 #include "EegeoWindowsGuard.h"
28 #include <GLES2/gl2.h>
29 #include <GLES2/gl2ext.h>
32 #include "VideoMemoryMonitor.h"
34 #if defined(EEGEO_UNITY)
35 #define Eegeo_GL_GET(default_valued_variable, getter)
38 #define Eegeo_GL_GET(default_valued_variable, getter) ((default_valued_variable) = (getter))
40 #if defined (EEGEO_DEBUG_GL)
41 #if defined (EEGEO_DROID)
42 #define Eegeo_GL(x) { \
44 EGLint eglError = eglGetError(); \
45 while(eglError!=EGL_SUCCESS) \
47 Eegeo_TTY("eglError (0x%x) at %s (%d)\n", eglError, __FILE__, __LINE__);\
48 eglError = eglGetError(); \
51 GLint glError = glGetError(); \
54 Eegeo_TTY("glError (0x%x) at %s (%d)\n", glError, __FILE__, __LINE__); \
55 glError = glGetError(); \
58 #elif defined (EMSCRIPTEN)
59 #define Eegeo_GL(x) { \
61 EGLint eglError = eglGetError(); \
62 while(eglError!=EGL_SUCCESS) \
64 emscripten_log(EM_LOG_ERROR, "eglError (0x%x) at %s (%d)\n", eglError, __FILE__, __LINE__);\
65 eglError = eglGetError(); \
68 GLint glError = glGetError(); \
71 emscripten_log(EM_LOG_ERROR, "glError (0x%x) at %s (%d)\n", glError, __FILE__, __LINE__); \
72 glError = glGetError(); \
75 #elif defined (EEGEO_IOS)
76 #define Eegeo_GL(x) { \
78 GLint glError = glGetError(); \
81 Eegeo_TTY("glError (0x%x) at %s (%d)\n", glError, __FILE__, __LINE__); \
82 Eegeo_ASSERT(false); \
83 glError = glGetError(); \
87 #elif defined (EEGEO_OSX) || defined (EEGEO_WIN)
88 #define Eegeo_GL(x) { \
90 GLint glError = glGetError(); \
93 Eegeo_TTY("glError (0x%x) at %s (%d)\n", glError, __FILE__, __LINE__); \
94 glError = glGetError(); \
100 #define Eegeo_GL(x) {(x);}