Add OffscreenView class
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2019 17:49:41 +0000 (20:49 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2019 17:49:41 +0000 (20:49 +0300)
This is a fairly thin wrapper around RenderTarget, mostly useful as an
abstraction.

source/offscreenview.cpp [new file with mode: 0644]
source/offscreenview.h [new file with mode: 0644]

diff --git a/source/offscreenview.cpp b/source/offscreenview.cpp
new file mode 100644 (file)
index 0000000..6d0d88b
--- /dev/null
@@ -0,0 +1,16 @@
+#include "offscreenview.h"
+#include "rendertarget.h"
+
+namespace Msp {
+namespace GL {
+
+OffscreenView::OffscreenView(Framebuffer &t):
+       View(t)
+{ }
+
+OffscreenView::OffscreenView(RenderTarget &t):
+       View(t.get_framebuffer())
+{ }
+
+} // namespace GL
+} // namespace Msp
diff --git a/source/offscreenview.h b/source/offscreenview.h
new file mode 100644 (file)
index 0000000..3de47f1
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef MSP_GL_OFFSCREENVIEW_H_
+#define MSP_GL_OFFSCREENVIEW_H_
+
+#include "view.h"
+
+namespace Msp {
+namespace GL {
+
+class Framebuffer;
+class RenderTarget;
+
+class OffscreenView: public View
+{
+public:
+       OffscreenView(Framebuffer &);
+       OffscreenView(RenderTarget &);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif