X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fquery.h;h=d5b83b960569911b5dd342351ec48567a0d98a1f;hb=6cee6c490ded0981c4da3f9f4ec74a41555e1a4e;hp=aaa993e389f2c17070fe7956d31bdc7fa3bcaa81;hpb=052b85720688900bc36f8844a94269cb1c0cdd52;p=libs%2Fgl.git diff --git a/source/core/query.h b/source/core/query.h index aaa993e3..d5b83b96 100644 --- a/source/core/query.h +++ b/source/core/query.h @@ -1,8 +1,8 @@ #ifndef MSP_GL_QUERY_H_ #define MSP_GL_QUERY_H_ -#include #include +#include "query_backend.h" namespace Msp { namespace GL { @@ -11,12 +11,18 @@ class Renderer; enum QueryType { + /** Query result indicates if any fragments passed the depth and stencil + tests. */ OCCLUSION_QUERY }; -class QueryPool: public Msp::NonCopyable +/** +A collection of query objects, which can be used to gather feedback from the +GPU. Semantics of the queries depend on the query type. +*/ +class QueryPool: public QueryPoolBackend, public Msp::NonCopyable { - friend class Commands; + friend QueryPoolBackend; public: class Activate @@ -33,21 +39,17 @@ public: private: QueryType type; - unsigned gl_type; - std::vector queries; + unsigned size; public: QueryPool(QueryType type, unsigned); - ~QueryPool(); void resize(unsigned); - unsigned get_size() const { return queries.size(); } + unsigned get_size() const { return size; } - unsigned get_result(unsigned) const; + using QueryPoolBackend::get_result; }; -unsigned get_gl_query_type(QueryType); - } // namespace Msp } // namespace GL