All Classes Files Functions Variables Typedefs Pages
RenderContext.hpp
1 #pragma once
2 #include "Program.fpp"
3 #include "FrameBuffer.hpp"
4 #include "RenderContext.fpp"
5 #include "HotRenderContext.fpp"
6 #include "GLException.hpp"
7 #include "GLObject.hpp"
8 #include "../service/StaticLogger.hpp"
9 #include "../config/BaseProxy.hpp"
10 
11 #include <functional>
12 
13 // forward declare GLFW types
14 struct GLFWwindow;
15 
16 
17 namespace lumina {
18 
20 public:
21  RenderContext(GLFWwindow* window);
22 
23  void create();
24  void prime(std::function<void(HotRenderContext&)> func);
25 
26  static HotRenderContext& getCurrentContext();
27  static bool isContextCurrent();
28 
29 
30 private:
31  GLFWwindow* m_windowHandle;
32  FrameBuffer m_defaultFB;
33  bool m_wasCreated;
34 
35  static HotRenderContext* s_primedContext;
36  static bool s_creationLock;
37  void makeCurrent();
38  void resetCurrent();
39  void configure();
40 
41  friend HotRenderContext;
42 };
43 
44 } // namespace lumina
45 
46 #include "RenderContext.tpp"
Definition: RenderContext.hpp:19
Definition: GLObject.hpp:18
Definition: HotRenderContext.hpp:11
Wrapper for either a UserFrameBuffer or the DefaultFrameBuffer (provides a layer of indirection) ...
Definition: FrameBuffer.hpp:107