From 25b3c84a5ac8867790669ee22c7f588e6eca66a6 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 26 May 2009 15:41:53 +0100 Subject: [PATCH] [cogl] Remove cogl_{create,destroy}_context from the public API cogl_create_context is dealt with internally when _cogl_get_default context is called, and cogl_destroy_context is currently never called. It might be nicer later to get an object back when creating a context so Cogl can support multiple contexts, so these functions are being removed from the API until we get a chance to address context management properly. For now cogl_destroy_context is still exported as _cogl_destroy_context so Clutter could at least install a library deinit handler to call it. --- cogl.h.in | 28 ++++++++++++---------------- doc/reference/cogl/cogl-sections.txt | 3 --- gl/cogl-context.c | 4 ++-- gles/cogl-context.c | 4 ++-- 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/cogl.h.in b/cogl.h.in index af4b26597..b5bb55d10 100644 --- a/cogl.h.in +++ b/cogl.h.in @@ -55,22 +55,6 @@ G_BEGIN_DECLS * General utility functions for COGL. */ -/* Context manipulation */ - -/** - * cogl_create_context: - * - * FIXME - */ -gboolean cogl_create_context (void); - -/** - * cogl_destroy_context: - * - * FIXME - */ -void cogl_destroy_context (void); - /** * cogl_get_option_group: * @@ -628,6 +612,18 @@ void cogl_push_draw_buffer (void); */ void cogl_pop_draw_buffer (void); + +/* + * Internal API available only to Clutter. + * + * These are typically only to deal with the poor seperation of + * responsabilities that currently exists between Clutter and Cogl. + * Eventually a lot of the backend code currently in Clutter will + * move down into Cogl and these functions will be removed. + */ + +void _cogl_destroy_context (void); + /* XXX: Removed before we release Clutter 1.0 since the implementation * wasn't complete, and so we assume no one is using this yet. Util we * have some one with a good usecase, we can't pretend to support breaking diff --git a/doc/reference/cogl/cogl-sections.txt b/doc/reference/cogl/cogl-sections.txt index 25f5e98c8..6ee2d9517 100644 --- a/doc/reference/cogl/cogl-sections.txt +++ b/doc/reference/cogl/cogl-sections.txt @@ -15,9 +15,6 @@ COGL_UNPREMULT_MASK CoglPixelFormat CoglBufferTarget -cogl_create_context -cogl_destroy_context - CoglFeatureFlags cogl_get_features cogl_features_available diff --git a/gl/cogl-context.c b/gl/cogl-context.c index db5541148..39415a02a 100644 --- a/gl/cogl-context.c +++ b/gl/cogl-context.c @@ -37,7 +37,7 @@ static CoglContext *_context = NULL; static gboolean gl_is_indirect = FALSE; -gboolean +static gboolean cogl_create_context () { GLubyte default_texture_data[] = { 0xff, 0xff, 0xff, 0x0 }; @@ -175,7 +175,7 @@ cogl_create_context () } void -cogl_destroy_context () +_cogl_destroy_context () { if (_context == NULL) return; diff --git a/gles/cogl-context.c b/gles/cogl-context.c index 1d2d02843..5b6ce7c1b 100644 --- a/gles/cogl-context.c +++ b/gles/cogl-context.c @@ -39,7 +39,7 @@ static CoglContext *_context = NULL; static gboolean gl_is_indirect = FALSE; -gboolean +static gboolean cogl_create_context () { GLubyte default_texture_data[] = { 0xff, 0xff, 0xff, 0x0 }; @@ -133,7 +133,7 @@ cogl_create_context () } void -cogl_destroy_context () +_cogl_destroy_context () { if (_context == NULL) return;