]> git.tdb.fi Git - libs/gl.git/blob - source/core/query.h
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / core / query.h
1 #ifndef MSP_GL_QUERY_H_
2 #define MSP_GL_QUERY_H_
3
4 #include <msp/core/noncopyable.h>
5 #include "query_backend.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Renderer;
11
12 enum QueryType
13 {
14         OCCLUSION_QUERY
15 };
16
17 class QueryPool: public QueryPoolBackend, public Msp::NonCopyable
18 {
19         friend QueryPoolBackend;
20
21 public:
22         class Activate
23         {
24         private:
25                 Renderer &renderer;
26                 const QueryPool &pool;
27                 unsigned index;
28
29         public:
30                 Activate(Renderer &, const QueryPool &, unsigned);
31                 ~Activate();
32         };
33
34 private:
35         QueryType type;
36
37 public:
38         QueryPool(QueryType type, unsigned);
39
40         using QueryPoolBackend::resize;
41         using QueryPoolBackend::get_size;
42
43         using QueryPoolBackend::get_result;
44 };
45
46 } // namespace Msp
47 } // namespace GL
48
49 #endif