Query.h
Go to the documentation of this file.
#pragma once
#include <chrono>
#include <glbinding/gl/types.h>
#include <globjects/globjects_api.h>
#include <globjects/Object.h>
namespace globjects
{
class GLOBJECTS_API Query : public Object
{
public:
Query();
static Query * fromId(gl::GLuint id);
static Query * current(gl::GLenum target);
static Query * timestamp();
static gl::GLint get(gl::GLenum target, gl::GLenum pname);
static gl::GLint getIndexed(gl::GLenum target, gl::GLuint index, gl::GLenum pname);
static gl::GLint getCounterBits(gl::GLenum target);
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;
static bool isQuery(gl::GLuint id);
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;
protected:
Query(IDResource * resource);
virtual ~Query();
static gl::GLuint genQuery();
void counter(gl::GLenum target) const;
};
} // 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