diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 4a45e7566..351ed19cb 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -1533,6 +1533,12 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer, framebuffer->dither_enabled = dither_enabled; } +CoglPixelFormat +cogl_framebuffer_get_color_format (CoglFramebuffer *framebuffer) +{ + return framebuffer->format; +} + CoglContext * cogl_framebuffer_get_context (CoglFramebuffer *framebuffer) { diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h index fb69da4e8..1935acf6a 100644 --- a/cogl/cogl-framebuffer.h +++ b/cogl/cogl-framebuffer.h @@ -261,6 +261,22 @@ void cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer, CoglColorMask color_mask); +#define cogl_framebuffer_get_color_format cogl_framebuffer_get_color_format_EXP +/** + * cogl_framebuffer_get_color_format: + * @framebuffer: A #CoglFramebuffer framebuffer + * + * Queries the common #CoglPixelFormat of all color buffers attached + * to this framebuffer. For an offscreen framebuffer created with + * cogl_offscreen_new_to_texture() this will correspond to the format + * of the texture. + * + * Since: 1.8 + * Stability: unstable + */ +CoglPixelFormat +cogl_framebuffer_get_color_format (CoglFramebuffer *framebuffer); + #define cogl_framebuffer_get_context cogl_framebuffer_get_context_EXP /** * @framebuffer: A #CoglFramebuffer