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

extensions.hpp
Go to the documentation of this file.
1 #ifndef EGLPLUS_EGL_API_EXTENSIONS_HPP
9 #define EGLPLUS_EGL_API_EXTENSIONS_HPP
10 
11 #include "objects.hpp"
12 
13 namespace eagine::eglp {
14 
15 template <typename ApiTraits>
16 class basic_egl_operations;
17 
20 template <typename ApiTraits, typename...>
22 public:
23  constexpr basic_egl_extension(
24  string_view name,
25  ApiTraits&,
26  const basic_egl_operations<ApiTraits>& api) noexcept
27  : _api{api}
28  , _name{name} {}
29 
31  explicit operator bool() const noexcept {
32  return _api.has_extension(_name);
33  }
34 
36  auto operator()() const noexcept -> bool {
37  return _api.has_extension(_name);
38  }
39 
40 private:
42  string_view _name;
43 };
44 
47 template <typename ApiTraits>
49 public:
50  constexpr basic_egl_extension(
51  string_view name,
52  ApiTraits&,
53  const basic_egl_operations<ApiTraits>& api) noexcept
54  : _api{api}
55  , _name{name} {}
56 
58  auto operator()(display_handle disp) const noexcept -> bool {
59  return _api.has_extension(disp, _name);
60  }
61 
62 private:
64  string_view _name;
65 };
66 
69 template <typename ApiTraits>
71 public:
72  constexpr basic_egl_extension(
73  string_view name,
74  ApiTraits&,
75  const basic_egl_operations<ApiTraits>& api) noexcept
76  : _api{api}
77  , _name{name} {}
78 
80  auto operator()(device_handle dev) const noexcept -> bool {
81  return _api.has_extension(dev, _name);
82  }
83 
84 private:
86  string_view _name;
87 };
88 
89 } // namespace eagine::eglp
90 
91 #endif // EGLPLUS_EGL_API_EXTENSIONS_HPP
auto operator()(display_handle disp) const noexcept -> bool
Tests if this extension is available on the specified display.
Definition: extensions.hpp:58
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
Class wrapping the functions from the EGL API.
Definition: api.hpp:37
auto operator()() const noexcept -> bool
Tests if this extension is available.
Definition: extensions.hpp:36
auto operator()(device_handle dev) const noexcept -> bool
Tests if this extension is available on the specified device.
Definition: extensions.hpp:80
Wrapper for device-specific EGL extension information getter.
Definition: extensions.hpp:70
Non-owning wrapper for C-API opaque handle types.
Definition: handle.hpp:26
Wrapper for EGL extension information getter.
Definition: extensions.hpp:21
Wrapper for display-specific EGL extension information getter.
Definition: extensions.hpp:48

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