OGLplus  (0.59.0) a C++ wrapper for rendering APIs

enum_class.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_GL_API_ENUM_CLASS_HPP
9 #define OGLPLUS_GL_API_ENUM_CLASS_HPP
10 
11 #include "config.hpp"
12 #include <eagine/enum_bitfield.hpp>
13 #include <eagine/enum_class.hpp>
14 #include <eagine/identifier.hpp>
16 
17 namespace eagine::oglp {
18 //------------------------------------------------------------------------------
30 template <typename Self, identifier_t Id>
31 using gl_enum_class =
33 
45 template <typename Self, identifier_t Id>
46 using gl_bitfield_class =
48 
59 template <typename Self, identifier_t Id>
60 using gl_ubyte_class =
62 
69 template <typename Self, identifier_t Id>
70 using gl_bool_class =
72 
80 
84 
85 static constexpr auto
87  return ::eagine::same_enum_class(a, b);
88 }
89 //------------------------------------------------------------------------------
90 template <
91  typename ParameterEnumClass,
92  typename Parameter,
93  typename ValueType,
94  typename Value>
95 constexpr static bool is_enum_parameter_value_v =
96  is_enum_class_value_v<ParameterEnumClass, Parameter>&&
97  std::is_same_v<typename Parameter::tag_type, nothing_t>
98  ? std::is_convertible_v<Value, ValueType>
99  : is_enum_class_value_v<typename Parameter::tag_type, Value>;
100 //------------------------------------------------------------------------------
101 } // namespace eagine::oglp
102 
103 #endif // OGLPLUS_GL_API_ENUM_CLASS_HPP
GLbitfield bitfield_type
Bit-field type.
Definition: config.hpp:55
Enum class for constants or enumerators (typically from a C-API).
Definition: enum_class.hpp:237
#define EAGINE_ID_V(NAME)
Macro for constructing instances of eagine::identifier_t.
Definition: identifier.hpp:359
GLenum enum_type
Enumeration type.
Definition: config.hpp:52
GLboolean bool_type
Boolean type.
Definition: config.hpp:49
GLubyte ubyte_type
Unsigned-byte type.
Definition: config.hpp:61
enum_class< Self, gl_types::enum_type, EAGINE_ID_V(GL), Id > gl_enum_class
Typed wrapper class for GLenum constants/values.
Definition: enum_class.hpp:32
Type erasure for instantiations of enum_value from a specified library.
Definition: enum_class.hpp:212
static constexpr auto same_enum_class(any_enum_class< LibId > a, any_enum_class< LibId > b) noexcept
Tests if two instances of any_enum_class belong to the same enum class.
Definition: enum_class.hpp:465
Type erasure for instantiations of enum_class from a specified library.
Definition: enum_class.hpp:385

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).