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

extensions.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_GL_API_EXTENSIONS_HPP
9 #define OGLPLUS_GL_API_EXTENSIONS_HPP
10 
11 #include <eagine/string_span.hpp>
12 
13 namespace eagine::oglp {
14 
15 template <typename ApiTraits>
16 class basic_gl_operations;
17 
20 template <typename ApiTraits>
22 public:
23  constexpr basic_gl_extension(
24  string_view name,
25  ApiTraits&,
26  const basic_gl_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 
45 } // namespace eagine::oglp
46 
47 #endif // OGLPLUS_GL_API_EXTENSIONS_HPP
auto operator()() const noexcept -> bool
Tests if this extension is available.
Definition: extensions.hpp:36
Class wrapping the functions from the GL API.
Definition: api.hpp:32
Wrapper for GL extension information getter.
Definition: extensions.hpp:21

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