diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2014-04-28 12:37:32 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2014-07-17 19:13:33 -0400 |
commit | b5b8ab91c035e096bcd41284e7b84cbe56b4a29f (patch) | |
tree | 8210ddf89e55b0567ab4c77977a521e977b65598 /cogl/cogl-framebuffer.h | |
parent | 728362c77b0ff804c196790dd93da84da2555b75 (diff) | |
download | cogl-b5b8ab91c035e096bcd41284e7b84cbe56b4a29f.tar.gz |
Add support for setting up stereo CoglOnscreens
If we want to show quad-buffer stereo with Cogl, we need to pick an
appropriate fbconfig for creating the CoglOnscreen objects. Add
cogl_onscreen_template_set_stereo_enabled() to indicate whether
stereo support is needed.
Add cogl_framebuffer_get_stereo_mode() to see if a framebuffer was
created with stereo support.
Add cogl_framebuffer_get_stereo_mode() to pick whether to draw to
the left, right, or both buffers.
Reviewed-by: Robert Bragg <robert.bragg@intel.com>
Diffstat (limited to 'cogl/cogl-framebuffer.h')
-rw-r--r-- | cogl/cogl-framebuffer.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h index c9f17ecf..df2412df 100644 --- a/cogl/cogl-framebuffer.h +++ b/cogl/cogl-framebuffer.h @@ -717,6 +717,23 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer); int cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer); +/* + * cogl_framebuffer_get_is_stereo: + * @framebuffer: a pointer to a #CoglFramebuffer + * + * Retrieves whether @framebuffer has separate left and right + * buffers for use with stereo drawing. See + * cogl_framebuffer_set_stereo_mode(). + * + * Return value: %TRUE if @framebuffer has separate left and + * right buffers. + * + * Since: 1.20 + * Stability: unstable + */ +CoglBool +cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer); + /** * cogl_framebuffer_get_dither_enabled: * @framebuffer: a pointer to a #CoglFramebuffer @@ -842,6 +859,41 @@ CoglPixelFormat cogl_framebuffer_get_color_format (CoglFramebuffer *framebuffer); /** + * cogl_framebuffer_get_stereo_mode: + * @framebuffer: a pointer to a #CoglFramebuffer + * + * Gets the current #CoglStereoMode, which defines which stereo buffers + * should be drawn to. See cogl_framebuffer_set_stereo_mode(). + * + * Returns: A #CoglStereoMode + * Since: 1.20 + * Stability: unstable + */ +CoglStereoMode +cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer); + +/** + * cogl_framebuffer_set_stereo_mode: + * @framebuffer: a pointer to a #CoglFramebuffer + * @stereo_mode: A #CoglStereoMode specifying which stereo buffers + * should be drawn tow. + * + * Sets which stereo buffers should be drawn to. The default + * is %COGL_STEREO_BOTH, which means that both the left and + * right buffers will be affected by drawing. For this to have + * an effect, the display system must support stereo drawables, + * and the framebuffer must have been created with stereo + * enabled. (See cogl_onscreen_template_set_stereo_enabled(), + * cogl_framebuffer_get_is_stereo().) + * + * Since: 1.20 + * Stability: unstable + */ +void +cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer, + CoglStereoMode stereo_mode); + +/** * cogl_framebuffer_set_depth_texture_enabled: * @framebuffer: A #CoglFramebuffer * @enabled: TRUE or FALSE |