From 4691b76467eadabfb0a7e810b12fe858a36ad519 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 24 May 2019 20:49:41 +0300 Subject: [PATCH] Add OffscreenView class This is a fairly thin wrapper around RenderTarget, mostly useful as an abstraction. --- source/offscreenview.cpp | 16 ++++++++++++++++ source/offscreenview.h | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 source/offscreenview.cpp create mode 100644 source/offscreenview.h diff --git a/source/offscreenview.cpp b/source/offscreenview.cpp new file mode 100644 index 00000000..6d0d88b0 --- /dev/null +++ b/source/offscreenview.cpp @@ -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 index 00000000..3de47f10 --- /dev/null +++ b/source/offscreenview.h @@ -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 -- 2.43.0