#ifndef MSP_GL_QUERY_H_
#define MSP_GL_QUERY_H_
-#include <vector>
-#include <msp/core/noncopyable.h>
+#include "query_backend.h"
namespace Msp {
namespace GL {
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
{
- friend class Commands;
+ friend QueryPoolBackend;
public:
class Activate
private:
QueryType type;
- unsigned gl_type;
- std::vector<unsigned> 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