From 6584c183f03d42f4785f33524d028f41eb212843 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 25 Aug 2011 17:39:35 +0100 Subject: [PATCH] context: Add an accessor to get display associated with the context https://bugzilla.gnome.org/show_bug.cgi?id=657347 Reviewed-by: Robert Bragg --- cogl/cogl-context.c | 6 ++++++ cogl/cogl-context.h | 4 ++++ .../cogl-2.0-experimental-sections.txt | 1 + 3 files changed, 11 insertions(+) diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c index 71e912d2b..02f05a653 100644 --- a/cogl/cogl-context.c +++ b/cogl/cogl-context.c @@ -495,6 +495,12 @@ _cogl_context_get_default (void) return _context; } +CoglDisplay * +cogl_context_get_display (CoglContext *context) +{ + return context->display; +} + #ifdef COGL_HAS_EGL_SUPPORT EGLDisplay cogl_egl_context_get_egl_display (CoglContext *context) diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h index 1b51ffc3c..9c616d347 100644 --- a/cogl/cogl-context.h +++ b/cogl/cogl-context.h @@ -61,6 +61,10 @@ CoglContext * cogl_context_new (CoglDisplay *display, GError **error); +#define cogl_context_get_display cogl_context_get_display_EXP +CoglDisplay * +cogl_context_get_display (CoglContext *context); + #ifdef COGL_HAS_EGL_SUPPORT #define cogl_egl_context_get_egl_display cogl_egl_context_get_egl_display_EXP EGLDisplay diff --git a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt index 35f4d63ef..00e77927e 100644 --- a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt +++ b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt @@ -72,6 +72,7 @@ cogl_wayland_display_set_compositor_display cogl_context_new +cogl_context_get_display cogl_push_matrix