]> git.tdb.fi Git - libs/gl.git/blob - source/backends/opengl/framebuffer_backend.h
24f43441b3aacb333821cb7d7823edf81b318153
[libs/gl.git] / source / backends / opengl / framebuffer_backend.h
1 #ifndef MSP_GL_FRAMEBUFFER_BACKEND_H_
2 #define MSP_GL_FRAMEBUFFER_BACKEND_H_
3
4 #include <string>
5 #include <msp/core/noncopyable.h>
6 #include "frameformat.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class OpenGLFramebuffer: public NonCopyable
12 {
13         friend class OpenGLCommands;
14         friend class OpenGLPipelineState;
15
16 protected:
17         unsigned id = 0;
18         mutable unsigned status;
19
20         OpenGLFramebuffer(bool);
21         OpenGLFramebuffer(OpenGLFramebuffer &&);
22         ~OpenGLFramebuffer();
23
24         void set_system_format(const FrameFormat &);
25         static bool is_format_supported(const FrameFormat &);
26         static void require_layered();
27
28         void resize_system(unsigned, unsigned);
29         void update(unsigned) const;
30         void require_complete() const;
31
32         void set_debug_name(const std::string &);
33 };
34
35 using FramebufferBackend = OpenGLFramebuffer;
36
37 } // namespace GL
38 } // namespace Msp
39
40 #endif