]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/framebuffer_backend.h
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / backends / opengl / framebuffer_backend.h
diff --git a/source/backends/opengl/framebuffer_backend.h b/source/backends/opengl/framebuffer_backend.h
new file mode 100644 (file)
index 0000000..84f6edd
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef MSP_GL_FRAMEBUFFER_BACKEND_H_
+#define MSP_GL_FRAMEBUFFER_BACKEND_H_
+
+#include <string>
+#include "frameformat.h"
+
+namespace Msp {
+namespace GL {
+
+class OpenGLFramebuffer
+{
+       friend class OpenGLCommands;
+       friend class OpenGLPipelineState;
+
+protected:
+       unsigned id;
+       mutable unsigned status;
+
+       OpenGLFramebuffer(bool);
+       ~OpenGLFramebuffer();
+
+       static FrameFormat get_system_format();
+       static void get_system_size(unsigned &, unsigned &);
+       static bool is_format_supported(const FrameFormat &);
+       static void require_layered();
+
+       void update(unsigned) const;
+       void require_complete() const;
+
+       void set_debug_name(const std::string &);
+};
+
+using FramebufferBackend = OpenGLFramebuffer;
+
+} // namespace GL
+} // namespace Msp
+
+#endif