class
AbstractQueryBase class for queries.
Contents
See PrimitiveQuery, SampleQuery and TimeQuery documentation for more information.
Base classes
- class AbstractObject
- Base for all OpenGL objects.
Derived classes
- class PrimitiveQuery
- Query for primitives.
- class SampleQuery
- Query for samples.
- class TimeQuery
- Query for elapsed time.
Constructors, destructors, conversion operators
- AbstractQuery(const AbstractQuery&) deleted
- Copying is not allowed.
- AbstractQuery(AbstractQuery&& other) noexcept
- Move constructor.
- ~AbstractQuery() protected
- Destructor.
Public functions
- auto operator=(const AbstractQuery&) -> AbstractQuery& deleted
- Copying is not allowed.
- auto operator=(AbstractQuery&& other) -> AbstractQuery& noexcept
- Move assignment.
- auto id() const -> GLuint
- OpenGL query ID.
- auto release() -> GLuint
- Release OpenGL object.
-
auto label() const -> std::
string - Query label.
-
auto setLabel(const std::
string& label) -> AbstractQuery& - Set query label.
-
template<std::auto setLabel(const char(&label)[size]) -> AbstractQuery&
size_t size> - auto resultAvailable() -> bool
- Whether the result is available.
-
template<class T>auto result() -> T
- Result.
- void begin()
- Begin query.
- void end()
- End query.
Function documentation
GLuint Magnum:: GL:: AbstractQuery:: release()
Release OpenGL object.
Releases ownership of OpenGL query object and returns its ID so it is not deleted on destruction. The internal state is then equivalent to moved-from state.
std:: string Magnum:: GL:: AbstractQuery:: label() const
Query label.
The result is not cached, repeated queries will result in repeated OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
AbstractQuery& Magnum:: GL:: AbstractQuery:: setLabel(const std:: string& label)
Set query label.
Returns | Reference to self (for method chaining) |
---|
Default is empty string. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
template<std:: size_t size>
AbstractQuery& Magnum:: GL:: AbstractQuery:: setLabel(const char(&label)[size])
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool Magnum:: GL:: AbstractQuery:: resultAvailable()
Whether the result is available.
template<class T>
T Magnum:: GL:: AbstractQuery:: result()
Result.
Template parameters | |
---|---|
T | Result type. Can be either bool , UnsignedInt, Int, UnsignedLong or Long. |
Note that this function is blocking until the result is available. See resultAvailable().