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

version.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_INTEROP_GLX_VERSION_HPP
10 #define EAGINE_INTEROP_GLX_VERSION_HPP
11 
12 #include "../x11/display.hpp"
13 
14 #include <GL/glx.h>
15 #include <stdexcept>
16 
17 namespace eagine::glx {
18 
19 class version {
20 private:
21  int _major{0};
22  int _minor{0};
23 
24 public:
25  version(const x11::display& dpy) {
26  if(!::glXQueryVersion(dpy, &_major, &_minor)) {
27  throw std::runtime_error("Error querying GLX version");
28  }
29  }
30 
31  void assert_at_least(int major, int minor) const {
32  if((_major < major) || ((_major == major) && (_minor < minor))) {
33  throw std::runtime_error("Invalid GLX version");
34  }
35  }
36 
37  auto major() const noexcept {
38  return _major;
39  }
40 
41  auto minor() const noexcept {
42  return _minor;
43  }
44 };
45 
46 } // namespace eagine::glx
47 
48 #endif
GLX wrapper code is placed in this namespace.
Definition: x11.hpp:14

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