cogl-buffer: Handle subclass registration like cogl-texture

Instead of having to extend cogl_is_buffer with new buffer types
manually this now adds a new COGL_BUFFER_DEFINE macro to be used instead
of COGL_OBJECT_DEFINE for CoglBuffer subclasses. This macro will
automatically register the new type with ctx->buffer_types which will
iterated by cogl_is_buffer. This is the same coding pattern used for
CoglTexture.
This commit is contained in:
Robert Bragg
2010-07-03 23:56:44 +01:00
parent 1b7e362189
commit 9ceb0edf26
5 changed files with 44 additions and 4 deletions

View File

@ -84,7 +84,7 @@ cogl_pixel_buffer_vtable;
static const CoglBufferVtable
cogl_malloc_pixel_buffer_vtable;
COGL_OBJECT_DEFINE (PixelBuffer, pixel_buffer)
COGL_BUFFER_DEFINE (PixelBuffer, pixel_buffer)
CoglPixelBuffer *
cogl_pixel_buffer_new (unsigned int size)