Radium Engine  1.5.20
Loading...
Searching...
No Matches
GlfwOpenGLContext.hpp
1#pragma once
2#ifdef HEADLESS_HAS_GLFW
3# include <Headless/OpenGLContext/OpenGLContext.hpp>
4
5struct GLFWwindow;
6
7namespace Ra {
8namespace Headless {
9
16class 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
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3