OGLplus defines many enumeration types grouping together GL constants that
logically belong together. The strong typing on the enumerations also prevents
in many cases errors like passing invalid constant to a GL function since
the OGLplus function wrappers use appropriate enumeration types for parameters
instead of the generic GLenum
type.
![]() |
Note |
---|---|
Many of the GL constant values used in the enumerations are only available in specific GL versions or with certain GL extensions. If the underlying GL constant is not defined when the enumeration definition is processed then the corresponding value is not present in the enumeration. |
For (almost) all enumeration types the following functions are overloaded.
template <typename Enumeration> Range<Enumeration> EnumValueRange(void);template <typename Enumeration> StrCRef EnumValueName(Enumeration enum_value);
![]()
Returns a Range
of values in a OGLplus enum value. This template function is overloaded
for the enumerated types defined by OGLplus and returns a Range
which allows to traverse all values of a particular |
|
Returns the name of the GL enumerated value for an OGLplus enum value.
This function is overloaded for the enumerated types defined by OGLplus
and returns the GL constant name (without the "GL_" prefix)
as managed const string reference. The result of this function is influenced
by the |
The EnumArray
template class is used by several functions
as the parameter type and allows to pass an array of multiple enumerated
values to be passed as an argument.
![]() |
Note |
---|---|
The lifetime of an instance of |
template <typename Enum> class EnumArray { public: template <std::size_t N> EnumArray(const Enum (&enums)[N]); EnumArray(const std::vector<Enum>& enums); EnumArray(size_t count, const Enum* enums); };
The OneOf
template class is used to merge several enumeration
types into a single type. Instances of OneOf
can be
implicitly constructed from a value from any of the merged enumeration
types. OneOf
is mostly used as the parameter type in
functions that can accept values from multiple different enumerations.
![]() |
Note |
---|---|
The following definition is just a pseudo-code used for documentation
purposes and differs from the actual implementation of |
template <typename ... Enum> class OneOf { public: OneOf(Enum)...;};