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

context_attribs.hpp
Go to the documentation of this file.
1 #ifndef EGLPLUS_EGL_API_CONTEXT_ATTRIBS_HPP
9 #define EGLPLUS_EGL_API_CONTEXT_ATTRIBS_HPP
10 
11 #include "config.hpp"
12 #include "enum_types.hpp"
13 #include <eagine/key_val_list.hpp>
14 
15 namespace eagine::eglp {
16 
22  using conv_type = egl_types::int_type;
25 
26  static constexpr auto terminator() noexcept -> egl_types::int_type {
27 #ifdef EGL_NONE
28  return EGL_NONE;
29 #else
30  return 0;
31 #endif
32  }
33 };
34 
39 
43 template <std::size_t N>
45 
50 
54 static constexpr auto
55 operator|(context_attribute key, egl_types::int_type value) noexcept
57  return {key, value};
58 }
59 
63 static constexpr auto operator|(
64  context_attribute key,
65  enum_bitfield<context_opengl_profile_bit> value) noexcept
67  return {key, egl_types::int_type(value)};
68 }
69 
73 static constexpr auto operator|(context_attribute key, bool value) noexcept
75 #if defined(EGL_TRUE) && defined(EGL_FALSE)
76  return {key, value ? EGL_TRUE : EGL_FALSE};
77 #else
78  return {key, value ? 1 : 0};
79 #endif
80 }
81 
82 } // namespace eagine::eglp
83 
84 #endif // EGLPLUS_EGL_API_CONTEXT_ATTRIBS_HPP
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
A single key/value pair for a key/value list.
Definition: key_val_list.hpp:27
Collection of aliases for EGL types.
Definition: config.hpp:52
Typed enumeration for EGL context attribute constants.
Definition: enum_types.hpp:110
key_value_list_element< context_attrib_traits > context_attribute_value
Alias for EGL context attribute list key/value pair.
Definition: context_attribs.hpp:49
Template for classes wrapping static key/value typically attribute lists.
Definition: key_val_list.hpp:21
EGLint int_type
Signed integer type.
Definition: config.hpp:116
Traits for EGL context attribute key/value list traits.
Definition: context_attribs.hpp:19
egl_types::int_type value_type
Alias for the value type.
Definition: context_attribs.hpp:24

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