Encapsulates a GL Query object.
More...
#include <globjects/include/globjects/Query.h>
|
| Query () |
|
virtual void | accept (ObjectVisitor &visitor) override |
|
void | begin (gl::GLenum target) const |
|
void | end (gl::GLenum target) const |
|
void | beginIndexed (gl::GLenum target, gl::GLuint index) const |
|
void | endIndexed (gl::GLenum target, gl::GLuint index) const |
|
gl::GLuint | get (gl::GLenum pname) const |
|
gl::GLuint64 | get64 (gl::GLenum pname) const |
|
bool | resultAvailable () const |
|
void | wait () const |
|
void | wait (const std::chrono::duration< int, std::nano > &timeout) const |
|
gl::GLuint | waitAndGet (gl::GLenum pname) const |
|
gl::GLuint64 | waitAndGet64 (gl::GLenum pname) const |
|
gl::GLuint | waitAndGet (const std::chrono::duration< int, std::nano > &timeout, gl::GLenum pname) const |
|
gl::GLuint64 | waitAndGet64 (const std::chrono::duration< int, std::nano > &timeout, gl::GLenum pname) const |
|
gl::GLuint | waitAndGet (gl::GLenum pname, const std::chrono::duration< int, std::nano > &timeout) const |
|
gl::GLuint64 | waitAndGet64 (gl::GLenum pname, const std::chrono::duration< int, std::nano > &timeout) const |
|
void | counter () const |
|
virtual gl::GLenum | objectType () const override |
|
gl::GLuint | id () const |
|
std::string | name () const |
|
void | setName (const std::string &name) |
|
bool | hasName () const |
|
bool | isDefault () const |
|
void | detach () |
|
| Referenced () |
|
void | ref () const |
|
void | unref () const |
|
int | refCounter () const |
|
| HeapOnly () |
|
void | destroy () const |
|
Encapsulates a GL Query object.
A Query object is used to query different aspects of the rendering pipeline, such as passed samples, generated primitives, written transform feedback primitives or elapsed time. With begin() and end(), the scope of the measurements could be specified. As a Query object queries the GPU asynchroneously, the result won't be available right after the end() invokation. The resultAvailable() method indicates whether the calling of get()/get64() will return the final result. To wait until the result is available, the wait() method can be used. Alternatively there are waitAndGet() and waitAndGet64() to query the result in one invokation.
There is a convenience method to create a Query object which answeres with the current timestamp on the GPU named timestamp() (see example below).
An example time measurement:
gl::GLuint timeElapsed = query->
get();
Encapsulates a GL Query object.
Definition Query.h:66
void end(gl::GLenum target) const
static gl::GLint get(gl::GLenum target, gl::GLenum pname)
void begin(gl::GLenum target) const
An example timestamp access:
gl::GLuint64 get64(gl::GLenum pname) const
static Query * timestamp()
- See also
- http://www.opengl.org/wiki/Query_Object
-
http://www.opengl.org/registry/specs/ARB/timer_query.txt
◆ Query() [1/2]
globjects::Query::Query |
( |
| ) |
|
◆ Query() [2/2]
globjects::Query::Query |
( |
IDResource * |
resource | ) |
|
|
protected |
◆ ~Query()
virtual globjects::Query::~Query |
( |
| ) |
|
|
protectedvirtual |
◆ fromId()
static Query * globjects::Query::fromId |
( |
gl::GLuint |
id | ) |
|
|
static |
◆ current()
static Query * globjects::Query::current |
( |
gl::GLenum |
target | ) |
|
|
static |
◆ timestamp()
static Query * globjects::Query::timestamp |
( |
| ) |
|
|
static |
◆ get() [1/2]
static gl::GLint globjects::Query::get |
( |
gl::GLenum |
target, |
|
|
gl::GLenum |
pname |
|
) |
| |
|
static |
◆ getIndexed()
static gl::GLint globjects::Query::getIndexed |
( |
gl::GLenum |
target, |
|
|
gl::GLuint |
index, |
|
|
gl::GLenum |
pname |
|
) |
| |
|
static |
◆ getCounterBits()
static gl::GLint globjects::Query::getCounterBits |
( |
gl::GLenum |
target | ) |
|
|
static |
◆ accept()
◆ begin()
void globjects::Query::begin |
( |
gl::GLenum |
target | ) |
const |
◆ end()
void globjects::Query::end |
( |
gl::GLenum |
target | ) |
const |
◆ beginIndexed()
void globjects::Query::beginIndexed |
( |
gl::GLenum |
target, |
|
|
gl::GLuint |
index |
|
) |
| const |
◆ endIndexed()
void globjects::Query::endIndexed |
( |
gl::GLenum |
target, |
|
|
gl::GLuint |
index |
|
) |
| const |
◆ isQuery()
static bool globjects::Query::isQuery |
( |
gl::GLuint |
id | ) |
|
|
static |
◆ get() [2/2]
gl::GLuint globjects::Query::get |
( |
gl::GLenum |
pname | ) |
const |
◆ get64()
gl::GLuint64 globjects::Query::get64 |
( |
gl::GLenum |
pname | ) |
const |
◆ resultAvailable()
bool globjects::Query::resultAvailable |
( |
| ) |
const |
◆ wait() [1/2]
void globjects::Query::wait |
( |
| ) |
const |
◆ wait() [2/2]
void globjects::Query::wait |
( |
const std::chrono::duration< int, std::nano > & |
timeout | ) |
const |
◆ waitAndGet() [1/3]
gl::GLuint globjects::Query::waitAndGet |
( |
gl::GLenum |
pname | ) |
const |
◆ waitAndGet64() [1/3]
gl::GLuint64 globjects::Query::waitAndGet64 |
( |
gl::GLenum |
pname | ) |
const |
◆ waitAndGet() [2/3]
gl::GLuint globjects::Query::waitAndGet |
( |
const std::chrono::duration< int, std::nano > & |
timeout, |
|
|
gl::GLenum |
pname |
|
) |
| const |
◆ waitAndGet64() [2/3]
gl::GLuint64 globjects::Query::waitAndGet64 |
( |
const std::chrono::duration< int, std::nano > & |
timeout, |
|
|
gl::GLenum |
pname |
|
) |
| const |
◆ waitAndGet() [3/3]
gl::GLuint globjects::Query::waitAndGet |
( |
gl::GLenum |
pname, |
|
|
const std::chrono::duration< int, std::nano > & |
timeout |
|
) |
| const |
◆ waitAndGet64() [3/3]
gl::GLuint64 globjects::Query::waitAndGet64 |
( |
gl::GLenum |
pname, |
|
|
const std::chrono::duration< int, std::nano > & |
timeout |
|
) |
| const |
◆ counter() [1/2]
void globjects::Query::counter |
( |
| ) |
const |
◆ objectType()
virtual gl::GLenum globjects::Query::objectType |
( |
| ) |
const |
|
overridevirtual |
◆ genQuery()
static gl::GLuint globjects::Query::genQuery |
( |
| ) |
|
|
staticprotected |
◆ counter() [2/2]
void globjects::Query::counter |
( |
gl::GLenum |
target | ) |
const |
|
protected |
The documentation for this class was generated from the following file: