namespace Msp {
namespace GL {
-OffscreenView::OffscreenView(Framebuffer &t):
- target(t)
-{ }
-
-OffscreenView::OffscreenView(RenderTarget &t):
- target(t.get_framebuffer())
+OffscreenView::OffscreenView(unsigned w, unsigned h, const FrameFormat &f):
+ target(w, h, f)
{ }
} // namespace GL
#define MSP_GL_OFFSCREENVIEW_H_
#include "mspgl_api.h"
+#include "rendertarget.h"
#include "view.h"
namespace Msp {
namespace GL {
-class Framebuffer;
-class RenderTarget;
-
/**
A View targeting an offscreen framebuffer.
*/
class MSPGL_API OffscreenView: public View
{
private:
- Framebuffer ⌖
+ RenderTarget target;
public:
- OffscreenView(Framebuffer &);
- OffscreenView(RenderTarget &);
+ OffscreenView(unsigned, unsigned, const FrameFormat &);
+
+ const Texture2D &get_target_texture(unsigned i = 0) const { return target.get_target_texture(i); }
+ const Texture2D &get_target_texture(FrameAttachment a) const { return target.get_target_texture(a); }
private:
- virtual const Framebuffer &get_target() const { return target; }
+ virtual const Framebuffer &get_target() const { return target.get_framebuffer(); }
};
} // namespace GL
unsigned get_width() const { return width; }
unsigned get_height() const { return height; }
const FrameFormat &get_format() const { return fbo.get_format(); }
- Framebuffer &get_framebuffer() { return fbo; }
+ const Framebuffer &get_framebuffer() const { return fbo; }
const Texture2D &get_target_texture(unsigned) const;
const Texture2D &get_target_texture(FrameAttachment) const;