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

config.hpp
Go to the documentation of this file.
1 #ifndef OALPLUS_ALUT_API_CONFIG_HPP
9 #define OALPLUS_ALUT_API_CONFIG_HPP
10 
11 #include "../al_api/config.hpp"
12 #include "../config/basic.hpp"
13 #include <eagine/maybe_unused.hpp>
14 
15 #ifndef OALPLUS_HAS_ALUT
16 #if defined(ALUT_ERROR_NO_ERROR)
17 #define OALPLUS_HAS_ALUT 1
18 #else
19 #define OALPLUS_HAS_ALUT 0
20 #endif
21 #endif // OALPLUS_HAS_ALUT
22 
23 #if !OALPLUS_HAS_ALUT
24 #include <cstdint>
25 #endif
26 
27 namespace eagine::oalp {
28 //------------------------------------------------------------------------------
31 struct alut_types {
32 
34  using bool_type = al_types::bool_type;
35 
37  using char_type = al_types::char_type;
38 
40  using enum_type = al_types::enum_type;
41 
43  using int_type = al_types::int_type;
44 
46  using uint_type = al_types::uint_type;
47 
49  using name_type = al_types::name_type;
50 
52  using size_type = al_types::size_type;
53 
55  using float_type = al_types::float_type;
56 
59 
62 #if OALPLUS_HAS_ALUT
63  static constexpr bool has_api = true;
64 #else
65  static constexpr bool has_api = false;
66 #endif
67 
68  static constexpr auto bool_true(bool_type b) noexcept -> bool {
69 #if OALPLUS_HAS_ALUT
70  return b == AL_TRUE;
71 #else
72  return b;
73 #endif
74  }
75 
76  static constexpr auto error_code_no_error(enum_type ec) noexcept -> bool {
77 #if OALPLUS_HAS_ALUT
78  return ec == ALUT_ERROR_NO_ERROR;
79 #else
80  EAGINE_MAYBE_UNUSED(ec);
81  return false;
82 #endif
83  }
84 };
85 //------------------------------------------------------------------------------
86 } // namespace eagine::oalp
87 
88 #endif // OALPLUS_ALUT_API_CONFIG_HPP
al_types::uint_type uint_type
Unsigned integer type.
Definition: config.hpp:46
al_types::int_type int_type
Integer type.
Definition: config.hpp:43
Collection of aliases for ALUT types.
Definition: config.hpp:31
al_types::bool_type bool_type
Boolean type.
Definition: config.hpp:34
const void * const_void_ptr_type
Untyped const pointer type.
Definition: config.hpp:35
al_types::void_ptr_type void_ptr_type
Untyped pointer type.
Definition: config.hpp:58
al_types::enum_type enum_type
Enum type.
Definition: config.hpp:40
al_types::name_type name_type
AL object handle type.
Definition: config.hpp:49
void * void_ptr_type
Untyped pointer type.
Definition: config.hpp:32
al_types::size_type size_type
Integer type used to store sizes and counts.
Definition: config.hpp:52
al_types::char_type char_type
String character type.
Definition: config.hpp:37
AL-related code is placed in this namespace.
Definition: oalplus.hpp:11
al_types::const_void_ptr_type const_void_ptr_type
Untyped const pointer type.
Definition: config.hpp:61
al_types::float_type float_type
Floating-point type.
Definition: config.hpp:55

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