]> git.tdb.fi Git - libs/gl.git/blob - source/core/query.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / query.h
1 #ifndef MSP_GL_QUERY_H_
2 #define MSP_GL_QUERY_H_
3
4 #include "query_backend.h"
5
6 namespace Msp {
7 namespace GL {
8
9 class Renderer;
10
11 enum QueryType
12 {
13         /** Query result indicates if any fragments passed the depth and stencil
14         tests. */
15         OCCLUSION_QUERY
16 };
17
18 /**
19 A collection of query objects, which can be used to gather feedback from the
20 GPU.  Semantics of the queries depend on the query type.
21 */
22 class QueryPool: public QueryPoolBackend
23 {
24         friend QueryPoolBackend;
25
26 public:
27         class Activate
28         {
29         private:
30                 Renderer &renderer;
31                 const QueryPool &pool;
32                 unsigned index;
33
34         public:
35                 Activate(Renderer &, const QueryPool &, unsigned);
36                 ~Activate();
37         };
38
39 private:
40         QueryType type;
41         unsigned size;
42
43 public:
44         QueryPool(QueryType type, unsigned);
45
46         void resize(unsigned);
47         unsigned get_size() const { return size; }
48
49         using QueryPoolBackend::get_result;
50 };
51
52 } // namespace Msp
53 } // namespace GL
54
55 #endif