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

context_attribs.hpp
Go to the documentation of this file.
1 #ifndef OALPLUS_ALC_API_CONTEXT_ATTRIBS_HPP
9 #define OALPLUS_ALC_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::oalp {
16 
22  using conv_type = alc_types::enum_type;
24  using value_type = alc_types::int_type;
25 
26  static constexpr auto terminator() noexcept -> alc_types::int_type {
27  return 0;
28  }
29 };
30 
33 template <std::size_t N>
35 
40 
44 static constexpr auto
45 operator|(context_attribute key, alc_types::int_type value) noexcept
47  return {key, value};
48 }
49 
53 static constexpr auto operator|(context_attribute key, bool value) noexcept
55 #if defined(ALC_TRUE) && defined(ALC_FALSE)
56  return {key, value ? ALC_TRUE : ALC_FALSE};
57 #else
58  return {key, value ? 1 : 0};
59 #endif
60 }
61 
62 } // namespace eagine::oalp
63 
64 #endif // OALPLUS_ALC_API_CONTEXT_ATTRIBS_HPP
A single key/value pair for a key/value list.
Definition: key_val_list.hpp:27
Collection of aliases for ALC types.
Definition: config.hpp:31
Typed enumeration for ALC context attribute constants.
Definition: enum_types.hpp:25
Traits for ALC context attribute key/value list traits.
Definition: context_attribs.hpp:19
alc_types::int_type value_type
Alias for the value type.
Definition: context_attribs.hpp:24
Template for classes wrapping static key/value typically attribute lists.
Definition: key_val_list.hpp:21
key_value_list_element< context_attrib_traits > context_attribute_value
Alias for ALC context attribute list key/value pair.
Definition: context_attribs.hpp:39
AL-related code is placed in this namespace.
Definition: oalplus.hpp:11

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