]> git.tdb.fi Git - libs/gl.git/blob - source/backends/opengl/framebuffer_backend.h
Rework multisample resolve to use resolve attachments
[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         unsigned resolve_id = 0;
19         mutable unsigned status;
20
21         OpenGLFramebuffer(bool);
22         OpenGLFramebuffer(OpenGLFramebuffer &&);
23         ~OpenGLFramebuffer();
24
25         void set_system_format(const FrameFormat &);
26         static bool is_format_supported(const FrameFormat &);
27         void format_changed(const FrameFormat &);
28         static void require_layered();
29
30         void resize_system(unsigned, unsigned);
31         void update(unsigned) const;
32         void update(unsigned, bool) const;
33         void require_complete() const;
34
35         void set_debug_name(const std::string &);
36 };
37
38 using FramebufferBackend = OpenGLFramebuffer;
39
40 } // namespace GL
41 } // namespace Msp
42
43 #endif