#include
<oglplus/query.hpp>
template <> struct ObjectSubtype<tag::Query> { typedef QueryTarget Type; };
template <> class ObjectOps<tag::DirectState, tag::Query> : public ObjZeroOps<tag::DirectState, tag::Query> { public: typedef QueryTarget Target; void Begin(QueryTarget target); void End(QueryTarget target); #if GL_VERSION_3_0 void BeginConditionalRender(ConditionalRenderMode mode); static void EndConditionalRender(void); #endif #if GL_VERSION_3_3 || GL_ARB_timer_query void Counter(QueryTarget target); void Timestamp(void); #endif Boolean ResultAvailable(void) const; void Result(GLint& result) const; void Result(GLuint& result) const; #if GL_VERSION_3_3 || GL_ARB_timer_query void Result(GLint64& result) const; void Result(GLuint64& result) const; #endif QueryActivator Activate(QueryTarget target); template <typename ResultType> QueryExecution<ResultType> Execute(QueryTarget target, ResultType& result); }; typedef ObjectOps<tag::DirectState, tag::Query> QueryOps;
Begins a query on the specified |
|
Ends the currently active query on the specified |
|
Begins conditional render on the query in the specified |
|
Ends currently active conditional render. See |
|
Does a counter query on the specified |
|
Does a timestamp query. See |
|
Returns true if the query result is available. See |
|
Returns the query result. See |
|
This function creates an instance of the |
|
This function creates an instance of the |
class QueryActivator { public: QueryActivator(QueryActivator&&); QueryActivator(QueryName query, QueryTarget target); ~QueryActivator(void) noexcept; bool Finish(void); };
Begins a |
|
Ends the currently active query. See |
|
Explicitly ends the query without waiting for the destructor. See
|
#if GL_VERSION_3_0 class ConditionalRender { public: ConditionalRender(ConditionalRender&&); ConditionalRender( QueryName query, ConditionalRenderMode mode ); ~ConditionalRender(void) noexcept; bool Finish(void); }; #endif
Begins conditional render on a |
|
Ends the currently active conditional render. See |
|
Explicitly ends the currently active conditional render. See |
template <typename ResultType> class QueryExecution : public QueryActivator { public: QueryExecution(QueryExecution&&); QueryExecution( QueryName query, QueryTarget target, ResultType& result ); ~QueryExecution(void) noexcept; void WaitForResult(void); };
Begins a |
|
Ends the currently active query and waits for the result. See |
|
Explicitly ends the query and waits for the result. See |
enum class QueryTarget : GLenum { TimeElapsed = GL_TIME_ELAPSED, Timestamp = GL_TIMESTAMP, SamplesPassed = GL_SAMPLES_PASSED, AnySamplesPassed = GL_ANY_SAMPLES_PASSED, PrimitivesGenerated = GL_PRIMITIVES_GENERATED, TransformFeedbackPrimitivesWritten = GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, VerticesSubmitted = GL_VERTICES_SUBMITTED_ARB, PrimitivesSubmitted = GL_PRIMITIVES_SUBMITTED_ARB, VertexShaderInvocations = GL_VERTEX_SHADER_INVOCATIONS_ARB, TessControlShaderPatches = GL_TESS_CONTROL_SHADER_PATCHES_ARB, TessEvaluationShaderInvocations = GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB, GeometryShaderInvocations = GL_GEOMETRY_SHADER_INVOCATIONS, GeometryShaderPrimitivesEmitted = GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB, FragmentShaderInvocations = GL_FRAGMENT_SHADER_INVOCATIONS_ARB, ComputeShaderInvocations = GL_COMPUTE_SHADER_INVOCATIONS_ARB, ClippingInputPrimitives = GL_CLIPPING_INPUT_PRIMITIVES_ARB, ClippingOutputPrimitives = GL_CLIPPING_OUTPUT_PRIMITIVES_ARB, TransformFeedbackOverflow = GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB, TransformFeedbackStreamOverflow = GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB }; template <> Range<QueryTarget> EnumValueRange<QueryTarget>(void); StrCRef EnumValueName(QueryTarget);
enum class ConditionalRenderMode : GLenum { QueryWait = GL_QUERY_WAIT, QueryNoWait = GL_QUERY_NO_WAIT, QueryByRegionWait = GL_QUERY_BY_REGION_WAIT, QueryByRegionNoWait = GL_QUERY_BY_REGION_NO_WAIT, QueryWaitInverted = GL_QUERY_WAIT_INVERTED, QueryNoWaitInverted = GL_QUERY_NO_WAIT_INVERTED, QueryByRegionWaitInverted = GL_QUERY_BY_REGION_WAIT_INVERTED, QueryByRegionNoWaitInverted = GL_QUERY_BY_REGION_NO_WAIT_INVERTED }; template <> Range<ConditionalRenderMode> EnumValueRange<ConditionalRenderMode>(void); StrCRef EnumValueName(ConditionalRenderMode);