[cogl/wip/msaa: 19/21] framebuffer: Add a getter for the framebuffer format



commit b2be355e94aa4eea7e7b545b058bb687d0e12766
Author: Robert Bragg <robert linux intel com>
Date:   Wed Aug 24 01:37:06 2011 +0100

    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.

 cogl/cogl-framebuffer.c |    6 ++++++
 cogl/cogl-framebuffer.h |   16 ++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 21903f3..2333e9f 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -1626,6 +1626,12 @@ cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
    * will end up with non-portable code. */
 }
 
+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 eecc27c..5e6fe01 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -366,6 +366,22 @@ cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
                                          int width,
                                          int height);
 
+#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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]