mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user