1
0
Fork 0

framebuffer: Add a getter for the framebuffer format

This adds a new function, cogl_framebuffer_get_color_format() to be able
to query the common pixel format for any color buffers attached to a
given CoglFramebuffer. For example an offscreen framebuffer created
using cogl_offscreen_new_to_texture() would have a format matching the
texture.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-08-24 01:37:06 +01:00
parent 476ff37fa6
commit 191d915671
2 changed files with 22 additions and 0 deletions

View file

@ -1533,6 +1533,12 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
framebuffer->dither_enabled = dither_enabled; framebuffer->dither_enabled = dither_enabled;
} }
CoglPixelFormat
cogl_framebuffer_get_color_format (CoglFramebuffer *framebuffer)
{
return framebuffer->format;
}
CoglContext * CoglContext *
cogl_framebuffer_get_context (CoglFramebuffer *framebuffer) cogl_framebuffer_get_context (CoglFramebuffer *framebuffer)
{ {

View file

@ -261,6 +261,22 @@ void
cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer, cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
CoglColorMask color_mask); 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 #define cogl_framebuffer_get_context cogl_framebuffer_get_context_EXP
/** /**
* @framebuffer: A #CoglFramebuffer * @framebuffer: A #CoglFramebuffer