Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.6.3
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GlfwOpenGLContext.hpp
1#pragma once
2#ifdef HEADLESS_HAS_GLFW
3# include <Headless/OpenGLContext/OpenGLContext.hpp>
4# include <Headless/RaHeadless.hpp>
5# include <functional>
6# include <string>
7
8namespace glbinding {
9class Version;
10} // namespace glbinding
11
12struct GLFWwindow;
13
14namespace Ra {
15namespace Headless {
16
23class HEADLESS_API GlfwOpenGLContext : public OpenGLContext
24{
25 public:
36 explicit GlfwOpenGLContext( const glbinding::Version& glVersion = { 4, 1 },
37 const std::array<int, 2>& size = { { 1, 1 } } );
38
39 ~GlfwOpenGLContext() override;
40 void makeCurrent() const override;
41 void doneCurrent() const override;
42 bool isValid() const override;
43 bool isWindow() const override { return true; }
44
45 [[nodiscard]] std::string getInfo() const override;
46
47 void show( EventMode mode, float delay ) override;
48 void hide() override;
49 void resize( const std::array<int, 2>& size ) override;
50 void renderLoop( std::function<void( float )> render ) override;
51
52 protected:
53 bool processEvents() override;
54
55 private:
56 GLFWwindow* m_glfwContext { nullptr };
57};
58
59} // namespace Headless
60} // namespace Ra
61#endif
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:4