diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-07-06 21:51:00 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2011-07-08 15:35:46 +0100 |
commit | 2b119b07da34f7aad987f032fb0987af9e7fbac6 (patch) | |
tree | 79466967949021f50e714a5d96d824dec61f7dc5 /cogl/cogl.c | |
parent | dae02a99a5c8c5f17188a0efb60eb8555e3e471f (diff) | |
download | cogl-2b119b07da34f7aad987f032fb0987af9e7fbac6.tar.gz |
Use all core GL functions through indirect pointers
cogl-ext-functions.h now contains definitions for all of the core GL
and GLES functions that we would normally link to directly. All of the
code has changed to access them through the cogl context pointer. The
GE macro now takes an extra parameter to specify the context because
the macro itself needs to make GL calls but various points in the Cogl
source use different names for the context variable.
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r-- | cogl/cogl.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c index 67f1ed19..ea4d7c8b 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -47,10 +47,6 @@ #include "cogl-attribute-private.h" #include "cogl-framebuffer-private.h" -#ifdef HAVE_COGL_GL -#define glClientActiveTexture ctx->drv.pf_glClientActiveTexture -#endif - #ifdef COGL_GL_DEBUG /* GL error to string conversion */ static const struct { @@ -154,14 +150,14 @@ toggle_flag (CoglContext *ctx, { if (!(ctx->enable_flags & flag)) { - GE( glEnable (gl_flag) ); + GE( ctx, glEnable (gl_flag) ); ctx->enable_flags |= flag; return TRUE; } } else if (ctx->enable_flags & flag) { - GE( glDisable (gl_flag) ); + GE( ctx, glDisable (gl_flag) ); ctx->enable_flags &= ~flag; } @@ -191,14 +187,14 @@ toggle_client_flag (CoglContext *ctx, { if (!(ctx->enable_flags & flag)) { - GE( glEnableClientState (gl_flag) ); + GE( ctx, glEnableClientState (gl_flag) ); ctx->enable_flags |= flag; return TRUE; } } else if (ctx->enable_flags & flag) { - GE( glDisableClientState (gl_flag) ); + GE( ctx, glDisableClientState (gl_flag) ); ctx->enable_flags &= ~flag; } @@ -307,9 +303,9 @@ _cogl_flush_face_winding (void) { if (winding == COGL_FRONT_WINDING_CLOCKWISE) - GE (glFrontFace (GL_CW)); + GE (ctx, glFrontFace (GL_CW)); else - GE (glFrontFace (GL_CCW)); + GE (ctx, glFrontFace (GL_CCW)); ctx->flushed_front_winding = winding; } } @@ -574,9 +570,9 @@ _cogl_read_pixels_with_rowstride (int x, _cogl_texture_driver_prep_gl_for_pixels_download (4 * width, 4); - GE( glReadPixels (x, y, width, height, - GL_RGBA, GL_UNSIGNED_BYTE, - tmp_data) ); + GE( ctx, glReadPixels (x, y, width, height, + GL_RGBA, GL_UNSIGNED_BYTE, + tmp_data) ); /* CoglBitmap doesn't currently have a way to convert without allocating its own buffer so we have to copy the data @@ -604,7 +600,7 @@ _cogl_read_pixels_with_rowstride (int x, { _cogl_texture_driver_prep_gl_for_pixels_download (rowstride, bpp); - GE( glReadPixels (x, y, width, height, gl_format, gl_type, pixels) ); + GE( ctx, glReadPixels (x, y, width, height, gl_format, gl_type, pixels) ); /* Convert to the premult format specified by the caller in-place. This will do nothing if the premult status is already |