Move all of the GL function pointers directly to CoglContext
Instead of storing all of the feature function pointers in the driver specific data of the CoglContext they are now all stored directly in CoglContext. There is a single header containing the description of the functions which gets included by cogl-context.h. There is a single function in cogl-feature-private.c to check for all of these functions. The name of the function pointer variables have been changed from ctx->drv.pf_glWhatever to just ctx->glWhatever. The feature flags that get set when an extension is available are now separated from the table of extensions. This is necessary because different extensions can mean different things on GLES and GL. For example, having access to glMapBuffer implies read and write support on GL but only write support on GLES. The flags are instead set in the driver specific init function by checking whether the function pointers were successfully resolved. _cogl_feature_check has been changed to assume the feature is supported if any of the listed extensions are available instead of requiring all of them. This makes it more convenient to specify alternate names for the extension. Nothing else had previously listed more than one name for an extension so this shouldn't cause any problems.
This commit is contained in:
@ -49,26 +49,26 @@
|
||||
|
||||
#if defined (HAVE_COGL_GL)
|
||||
|
||||
#define glGenBuffers ctx->drv.pf_glGenBuffers
|
||||
#define glBindBuffer ctx->drv.pf_glBindBuffer
|
||||
#define glBufferData ctx->drv.pf_glBufferData
|
||||
#define glBufferSubData ctx->drv.pf_glBufferSubData
|
||||
#define glGetBufferSubData ctx->drv.pf_glGetBufferSubData
|
||||
#define glDeleteBuffers ctx->drv.pf_glDeleteBuffers
|
||||
#define glMapBuffer ctx->drv.pf_glMapBuffer
|
||||
#define glUnmapBuffer ctx->drv.pf_glUnmapBuffer
|
||||
#define glClientActiveTexture ctx->drv.pf_glClientActiveTexture
|
||||
#define glGenBuffers ctx->glGenBuffers
|
||||
#define glBindBuffer ctx->glBindBuffer
|
||||
#define glBufferData ctx->glBufferData
|
||||
#define glBufferSubData ctx->glBufferSubData
|
||||
#define glGetBufferSubData ctx->glGetBufferSubData
|
||||
#define glDeleteBuffers ctx->glDeleteBuffers
|
||||
#define glMapBuffer ctx->glMapBuffer
|
||||
#define glUnmapBuffer ctx->glUnmapBuffer
|
||||
#define glClientActiveTexture ctx->glClientActiveTexture
|
||||
#ifndef GL_ARRAY_BUFFER
|
||||
#define GL_ARRAY_BUFFER GL_ARRAY_BUFFER_ARB
|
||||
#endif
|
||||
|
||||
#define glVertexAttribPointer ctx->drv.pf_glVertexAttribPointer
|
||||
#define glEnableVertexAttribArray ctx->drv.pf_glEnableVertexAttribArray
|
||||
#define glDisableVertexAttribArray ctx->drv.pf_glDisableVertexAttribArray
|
||||
#define glVertexAttribPointer ctx->glVertexAttribPointer
|
||||
#define glEnableVertexAttribArray ctx->glEnableVertexAttribArray
|
||||
#define glDisableVertexAttribArray ctx->glDisableVertexAttribArray
|
||||
#define MAY_HAVE_PROGRAMABLE_GL
|
||||
|
||||
#define glDrawRangeElements(mode, start, end, count, type, indices) \
|
||||
ctx->drv.pf_glDrawRangeElements (mode, start, end, count, type, indices)
|
||||
ctx->glDrawRangeElements (mode, start, end, count, type, indices)
|
||||
|
||||
#else /* GLES 1/2 */
|
||||
|
||||
|
Reference in New Issue
Block a user