diff options
author | Hans Petter Jansson <hpj@cl.no> | 2013-10-10 18:10:52 +0200 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-10-28 16:34:58 +0000 |
commit | a8e04a7d6b71662d4380a6431b1b11d401934a61 (patch) | |
tree | ba93f6400a7440ff1ffaa8077cdbd6180442d161 /cogl/cogl-framebuffer.h | |
parent | 18486a6aa9477c9060f07b554ac76dae49f4810d (diff) | |
download | cogl-a8e04a7d6b71662d4380a6431b1b11d401934a61.tar.gz |
Add API to control per-framebuffer depth writing
Add framebuffer methods cogl_framebuffer_[gs]et_depth_write_enabled()
and backend bits to pass the state on to glDepthMask().
This allows us to enable or disable depth writing per-framebuffer, which
if disabled saves us some work in glClear(). When rendering, the flag
is combined with the pipeline's depth writing flag using a logical AND.
Depth writing is enabled by default.
https://bugzilla.gnome.org/show_bug.cgi?id=709827
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 71406438c5357eb4e0ef03e940c5456a536602a0)
Diffstat (limited to 'cogl/cogl-framebuffer.h')
-rw-r--r-- | cogl/cogl-framebuffer.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h index e3dad9fa..45f01571 100644 --- a/cogl/cogl-framebuffer.h +++ b/cogl/cogl-framebuffer.h @@ -758,6 +758,39 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer, CoglBool dither_enabled); /** + * cogl_framebuffer_get_depth_write_enabled: + * @framebuffer: a pointer to a #CoglFramebuffer + * + * Queries whether depth buffer writing is enabled for @framebuffer. This + * can be controlled via cogl_framebuffer_set_depth_write_enabled(). + * + * Return value: %TRUE if depth writing is enabled or %FALSE if not. + * Since: 1.18 + * Stability: unstable + */ +CoglBool +cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer); + +/** + * cogl_framebuffer_set_depth_write_enabled: + * @framebuffer: a pointer to a #CoglFramebuffer + * @depth_write_enabled: %TRUE to enable depth writing or %FALSE to disable + * + * Enables or disables depth buffer writing when rendering to @framebuffer. + * If depth writing is enabled for both the framebuffer and the rendering + * pipeline, and the framebuffer has an associated depth buffer, depth + * information will be written to this buffer during rendering. + * + * Depth buffer writing is enabled by default. + * + * Since: 1.18 + * Stability: unstable + */ +void +cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer, + CoglBool depth_write_enabled); + +/** * cogl_framebuffer_get_color_mask: * @framebuffer: a pointer to a #CoglFramebuffer * |