Loading [MathJax]/extensions/tex2jax.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
GlfwOpenGLContext.hpp
1 #pragma once
2 #ifdef HEADLESS_HAS_GLFW
3 # include <Headless/OpenGLContext/OpenGLContext.hpp>
4 
5 struct GLFWwindow;
6 
7 namespace Ra {
8 namespace Headless {
9 
16 class HEADLESS_API GlfwOpenGLContext : public OpenGLContext
17 {
18  public:
29  explicit GlfwOpenGLContext( const glbinding::Version& glVersion = { 4, 1 },
30  const std::array<int, 2>& size = { { 1, 1 } } );
31 
32  ~GlfwOpenGLContext() override;
33  void makeCurrent() const override;
34  void doneCurrent() const override;
35  bool isValid() const override;
36  bool isWindow() const override { return true; }
37 
38  [[nodiscard]] std::string getInfo() const override;
39 
40  void show( EventMode mode, float delay ) override;
41  void hide() override;
42  void resize( const std::array<int, 2>& size ) override;
43  void renderLoop( std::function<void( float )> render ) override;
44 
45  protected:
46  bool processEvents() override;
47 
48  private:
49  GLFWwindow* m_glfwContext { nullptr };
50 };
51 
52 } // namespace Headless
53 } // namespace Ra
54 #endif
Definition: Cage.cpp:3