--- /dev/null
+#ifndef MSP_GL_QUERY_H_
+#define MSP_GL_QUERY_H_
+
+#include <vector>
+#include <msp/core/noncopyable.h>
+
+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<unsigned> 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