X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fquery.h;fp=source%2Fcore%2Fquery.h;h=aaa993e389f2c17070fe7956d31bdc7fa3bcaa81;hb=052b85720688900bc36f8844a94269cb1c0cdd52;hp=0000000000000000000000000000000000000000;hpb=bae374a3cda6a1b59f36016624ef518bf2676355;p=libs%2Fgl.git diff --git a/source/core/query.h b/source/core/query.h new file mode 100644 index 00000000..aaa993e3 --- /dev/null +++ b/source/core/query.h @@ -0,0 +1,54 @@ +#ifndef MSP_GL_QUERY_H_ +#define MSP_GL_QUERY_H_ + +#include +#include + +namespace Msp { +namespace GL { + +class Renderer; + +enum QueryType +{ + OCCLUSION_QUERY +}; + +class QueryPool: public Msp::NonCopyable +{ + friend class Commands; + +public: + class Activate + { + private: + Renderer &renderer; + const QueryPool &pool; + unsigned index; + + public: + Activate(Renderer &, const QueryPool &, unsigned); + ~Activate(); + }; + +private: + QueryType type; + unsigned gl_type; + std::vector queries; + +public: + QueryPool(QueryType type, unsigned); + ~QueryPool(); + + void resize(unsigned); + unsigned get_size() const { return queries.size(); } + + unsigned get_result(unsigned) const; +}; + +unsigned get_gl_query_type(QueryType); + +} // namespace Msp +} // namespace GL + +#endif