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

@ -42,20 +42,19 @@ COGL_BUFFER_DEFINE (IndexBuffer, index_buffer);
* indices buffer should be able to contain multiple ranges of indices
* which the wiki design doesn't currently consider. */
CoglIndexBuffer *
cogl_index_buffer_new (gsize bytes)
cogl_index_buffer_new (CoglContext *context, gsize bytes)
{
CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
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 (indices),
context,
bytes,
use_malloc,
COGL_BUFFER_BIND_TARGET_INDEX_BUFFER,