13 #ifndef OGLPLUS_LIMITED_VALUE_1107121519_HPP
14 #define OGLPLUS_LIMITED_VALUE_1107121519_HPP
22 template <GLenum Query>
25 template <GLenum Query>
38 template <GLenum Query>
44 static GLuint _query_limit(
void)
47 OGLPLUS_GLFUNC(GetIntegerv)(
Query, &limit);
48 OGLPLUS_VERIFY_SIMPLE(GetIntegerv);
52 static GLuint _limit(
void)
54 static GLuint limit = _query_limit();
65 OGLPLUS_HANDLE_ERROR_IF(
68 LimitError::Message(),
72 EnumParam(
Query, query_name)
79 _value = other._value;
80 assert(_value < _limit());
84 #if OGLPLUS_DOCUMENTATION_ONLY
85 template <
typename Type>
87 explicit operator Type(
void)
const;
90 template <
typename Type>
91 #if !OGLPLUS_NO_EXPLICIT_CONVERSION_OPERATORS
92 explicit operator Type(
void) const
94 operator Type(
void) const
100 friend GLuint LimitedCountMax<Query>(
const LimitedCount&);
104 return a._value == b._value;
109 return a._value != b._value;
114 return a._value <= b._value;
119 return a._value < b._value;
124 return a._value >= b._value;
129 return a._value > b._value;
133 template <GLenum Query>
134 inline GLuint LimitedCountMax(
const LimitedCount<Query>& lim_count)
136 return lim_count._limit();
139 inline GLuint LimitedCountMax(GLuint lim_count)
144 #define OGLPLUS_DECLARE_LIMITED_COUNT_TYPE(NAME, QUERY) \
146 : public LimitedCount<GL_ ## QUERY> \
149 typedef GLuint _value_type; \
150 NAME(GLuint value = 0) \
151 : LimitedCount<GL_ ## QUERY>(value, #QUERY) \
157 #endif // include guard
Exception indicating exceeded implementation-defined limits.
Definition: limit.hpp:30
Base class for limited implementation-dependent numeric values.
Definition: limited_value.hpp:23
Helper macro for optional checking of availability of GL function.
Object< QueryOps > Query
An oglplus_object encapsulating the asynchronous query functionality.
Definition: query.hpp:537
LimitedCount(GLuint value, const char *query_name)
Definition: limited_value.hpp:62