| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

Query.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <chrono>
5
6 #include <glbinding/gl/types.h>
7
8 #include <globjects/globjects_api.h>
9 #include <globjects/Object.h>
10
11
12 namespace globjects
13 {
14
15
65 class GLOBJECTS_API Query : public Object
66 {
67 public:
68 Query();
69 static Query * fromId(gl::GLuint id);
70
71 static Query * current(gl::GLenum target);
72 static Query * timestamp();
73
74 static gl::GLint get(gl::GLenum target, gl::GLenum pname);
75 static gl::GLint getIndexed(gl::GLenum target, gl::GLuint index, gl::GLenum pname);
76
77 static gl::GLint getCounterBits(gl::GLenum target);
78
79 virtual void accept(ObjectVisitor& visitor) override;
80
81 void begin(gl::GLenum target) const;
82 void end(gl::GLenum target) const;
83
84 void beginIndexed(gl::GLenum target, gl::GLuint index) const;
85 void endIndexed(gl::GLenum target, gl::GLuint index) const;
86
87 static bool isQuery(gl::GLuint id);
88
89 gl::GLuint get(gl::GLenum pname) const;
90 gl::GLuint64 get64(gl::GLenum pname) const;
91
92 bool resultAvailable() const;
93 void wait() const;
94 void wait(const std::chrono::duration<int, std::nano> & timeout) const;
95
96 gl::GLuint waitAndGet(gl::GLenum pname) const;
97 gl::GLuint64 waitAndGet64(gl::GLenum pname) const;
98
99 gl::GLuint waitAndGet(const std::chrono::duration<int, std::nano> & timeout, gl::GLenum pname) const;
100 gl::GLuint64 waitAndGet64(const std::chrono::duration<int, std::nano> & timeout, gl::GLenum pname) const;
101
102 gl::GLuint waitAndGet(gl::GLenum pname, const std::chrono::duration<int, std::nano> & timeout) const;
103 gl::GLuint64 waitAndGet64(gl::GLenum pname, const std::chrono::duration<int, std::nano> & timeout) const;
104
105 void counter() const;
106
107 virtual gl::GLenum objectType() const override;
108
109 protected:
110
111 Query(IDResource * resource);
112 virtual ~Query();
113
114 static gl::GLuint genQuery();
115
116 void counter(gl::GLenum target) const;
117 };
118
119
120 } // namespace globjects
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::Object
Superclass of all wrapped OpenGL objects.
Definition: Object.h:26
globjects::Query
Encapsulates a GL Query object.
Definition: Query.h:65
globjects::ObjectVisitor
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition: ObjectVisitor.h:29
Object.h