gl: add support for building against GLES3 headers

with a fallback to GLES2 headers if available.
This commit is contained in:
Matthew Waters 2016-03-31 19:43:04 +11:00 committed by Tim-Philipp Müller
parent 0c2890cd34
commit 97e66be37d
3 changed files with 17 additions and 10 deletions

View file

@ -27,23 +27,30 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* SUPPORTED */ #ifndef GL_RGB16
//FIXME:
#define GL_RGB16 GL_RGB565 #define GL_RGB16 GL_RGB565
#endif
#ifndef GL_RGB8
#define GL_RGB8 GL_RGB #define GL_RGB8 GL_RGB
//END FIXME #endif
/* UNSUPPORTED */ /* UNSUPPORTED */
#define GL_COLOR_ATTACHMENT1 0 #ifndef GL_COLOR_ATTACHMENT1
#define GL_COLOR_ATTACHMENT2 0 #define GL_COLOR_ATTACHMENT1 0x8CE1
#endif
#ifndef GL_COLOR_ATTACHMENT2
#define GL_COLOR_ATTACHMENT2 0x8CE2
#endif
#ifndef GL_TEXTURE_ENV #ifndef GL_TEXTURE_ENV
#define GL_TEXTURE_ENV 0 #define GL_TEXTURE_ENV 0
#endif #endif
#ifndef GL_TEXTURE_ENV_MODE #ifndef GL_TEXTURE_ENV_MODE
#define GL_TEXTURE_ENV_MODE 0 #define GL_TEXTURE_ENV_MODE 0
#endif #endif
#define GL_DEPTH24_STENCIL8 0 #ifndef GL_DEPTH24_STENCIL8
#define GL_DEPTH24_STENCIL8 0x88F0
#endif
G_END_DECLS G_END_DECLS

View file

@ -41,6 +41,10 @@
# else # else
# include <GLES2/gl2.h> # include <GLES2/gl2.h>
# include <GLES2/gl2ext.h> # include <GLES2/gl2ext.h>
# if GST_GL_HAVE_GLES3
# include <GLES3/gl3.h>
# include <GLES3/gl3ext.h>
# endif
# endif # endif
# if !GST_GL_HAVE_OPENGL # if !GST_GL_HAVE_OPENGL
# include <gst/gl/glprototypes/gstgl_gles2compat.h> # include <gst/gl/glprototypes/gstgl_gles2compat.h>

View file

@ -132,10 +132,6 @@ load_self_module (gpointer user_data)
return NULL; return NULL;
} }
#if GST_GL_HAVE_GLES3
#error "Add module loading support for GLES3"
#endif
/* Context sharedness is tracked by a refcounted pointer stored in each context /* Context sharedness is tracked by a refcounted pointer stored in each context
* object to track complex creation/deletion scenarios. As a result, * object to track complex creation/deletion scenarios. As a result,
* sharedness can only be successfully validated between two GstGLContext's * sharedness can only be successfully validated between two GstGLContext's