From c08b1263e113966d5f7c107683e16f6d9fabc17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Aug 2014 14:22:23 +0200 Subject: [PATCH] Support for ARB_conditional_render_inverted (GL 4.5). That was easy. --- doc/opengl-support.dox | 2 +- src/Magnum/SampleQuery.h | 40 +++++++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 93ec8687c..fb75af729 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -210,7 +210,7 @@ following: -------------------------------------------- | ------ @extension{ARB,ES3_1_compatibility} | | @extension{ARB,clip_control} | | -@extension{ARB,conditional_render_inverted} | | +@extension{ARB,conditional_render_inverted} | done @extension{ARB,cull_distance} | | @extension{ARB,derivative_control} | done (shading language only) @extension{ARB,direct_state_access} | | diff --git a/src/Magnum/SampleQuery.h b/src/Magnum/SampleQuery.h index a97609894..9fee36ccf 100644 --- a/src/Magnum/SampleQuery.h +++ b/src/Magnum/SampleQuery.h @@ -117,28 +117,58 @@ class SampleQuery: public AbstractQuery { */ enum class ConditionalRenderMode: GLenum { /** - * If query result is not yet available, waits for it and - * then begins conditional rendering based on result value. + * If query result is not yet available, waits for it and then + * begins rendering only if result is nonzero. */ Wait = GL_QUERY_WAIT, /** - * If query result is not yet available, OpenGL may begin - * rendering like if the result value was nonzero. + * If query result is not yet available, waits for it and then + * begins rendering only if result is zero. + * @requires_gl45 %Extension @extension{ARB,conditional_render_inverted} + */ + WaitInverted = GL_QUERY_WAIT_INVERTED, + + /** + * If query result is not yet available, begins rendering like if + * the result was nonzero. */ NoWait = GL_QUERY_NO_WAIT, + /** + * If query result is not yet available, begins rendering like if + * the result was zero. + * @requires_gl45 %Extension @extension{ARB,conditional_render_inverted} + */ + NoWaitInverted = GL_QUERY_NO_WAIT_INVERTED, + /** * The same as @ref ConditionalRenderMode::Wait, but regions * untouched by the sample query may not be rendered at all. */ ByRegionWait = GL_QUERY_BY_REGION_WAIT, + /** + * The same as @ref ConditionalRenderMode::WaitInverted, but + * regions untouched by the sample query may not be rendered at + * all. + * @requires_gl45 %Extension @extension{ARB,conditional_render_inverted} + */ + ByRegionWaitInverted = GL_QUERY_BY_REGION_WAIT_INVERTED, + /** * The same as @ref ConditionalRenderMode::NoWait, but regions * untouched by the sample query may not be rendered at all. */ - ByRegionNoWait = GL_QUERY_BY_REGION_NO_WAIT + ByRegionNoWait = GL_QUERY_BY_REGION_NO_WAIT, + + /** + * The same as @ref ConditionalRenderMode::NoWaitInverted, but + * regions untouched by the sample query may not be rendered at + * all. + * @requires_gl45 %Extension @extension{ARB,conditional_render_inverted} + */ + ByRegionNoWaitInverted = GL_QUERY_BY_REGION_NO_WAIT_INVERTED }; #endif