buffer: explicitly relate buffers to a context

All CoglBuffer constructors now take an explicit CoglContext
constructor. This is part of the on going effort to adapt to Cogl API so
it no longer depends on a global, default context.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg
2012-02-06 17:08:58 +00:00
parent 269878217f
commit 3ea6acc072
26 changed files with 214 additions and 148 deletions

View File

@ -39,20 +39,21 @@ static void _cogl_attribute_buffer_free (CoglAttributeBuffer *array);
COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
CoglAttributeBuffer *
cogl_attribute_buffer_new (gsize bytes, const void *data)
cogl_attribute_buffer_new (CoglContext *context,
gsize bytes,
const void *data)
{
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
gboolean use_malloc;
_COGL_GET_CONTEXT (ctx, NULL);
if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
use_malloc = TRUE;
else
use_malloc = FALSE;
/* parent's constructor */
_cogl_buffer_initialize (COGL_BUFFER (array),
context,
bytes,
use_malloc,
COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,