1 #ifndef RENDERTARGET_H_
2 #define RENDERTARGET_H_
4 #include <msp/core/noncopyable.h>
5 #include "framebuffer.h"
14 Wraps a Framebuffer and its attachments for easier management.
16 All attachments will be created as 2D or 2D multisample textures, depending on
17 the sample count of the format.
19 class RenderTarget: public NonCopyable
24 std::vector<Texture *> textures;
28 RenderTarget(unsigned, unsigned, const FrameFormat & = (COLOR_ATTACHMENT, DEPTH_ATTACHMENT));
29 RenderTarget(RenderTarget &&) = default;
32 unsigned get_width() const { return width; }
33 unsigned get_height() const { return height; }
34 const FrameFormat &get_format() const { return fbo.get_format(); }
35 Framebuffer &get_framebuffer() { return fbo; }
36 const Texture2D &get_target_texture(unsigned) const;
37 const Texture2D &get_target_texture(FrameAttachment) const;
39 void set_debug_name(const std::string &);