PrevUpHomeNext

Limited values

#include <oglplus/limited_value.hpp>

LimitedCount is a base class storing limited implementation-dependent numeric values. It checks if the given numeric value is in the implementation-dependent range of allowed values and throws an LimitError exception if it is not.

[Note] Note

Do not use this templates directly, use the derived types or the typedefs of instantiations instead.

template <GLenum Query>
class LimitedCount
{
public:
	template <typename Type>
	explicit operator Type(void) const; 1

	friend bool operator == (LimitedCount a, LimitedCount b);
	friend bool operator != (LimitedCount a, LimitedCount b);
	friend bool operator <= (LimitedCount a, LimitedCount b);
	friend bool operator <  (LimitedCount a, LimitedCount b);
	friend bool operator >= (LimitedCount a, LimitedCount b);
	friend bool operator >  (LimitedCount a, LimitedCount b);
};

template <GLenum Query>
GLuint LimitedCountMax(const LimitedCount<Query>& lim_count); 2

1

Explicit conversion of the internally stored value to a value of the specified numeric Type.

2

Returns the maximum for the specified limited value type.

Examples of usage

Texture::Active(0); 1

TextureUnitSelector tex_unit = 2;

Texture::Active(tex_unit);

Texture::Active(std::numeric_limits<GLuint>::max()); 2

1

Implicit conversion of numeric value to TextureUnitSelector (derived from LimitedCount).

2

Very probably will throw LimitError.


PrevUpHomeNext