}
}
+unsigned Framebuffer::get_attachment_index(FramebufferAttachment attch)
+{
+ for(unsigned i=0; i<attachments.size(); ++i)
+ if(attachments[i].attachment==attch)
+ return i;
+ attachments.push_back(Attachment(attch));
+ return attachments.size()-1;
+}
+
void Framebuffer::attach(FramebufferAttachment attch, Renderbuffer &rbuf)
{
if(!id)
return sys_framebuf;
}
-unsigned Framebuffer::get_attachment_index(FramebufferAttachment attch)
-{
- for(unsigned i=0; i<attachments.size(); ++i)
- if(attachments[i].attachment==attch)
- return i;
- attachments.push_back(Attachment(attch));
- return attachments.size()-1;
-}
-
Framebuffer::Attachment::Attachment(FramebufferAttachment a):
attachment(a),
private:
void update_attachment(unsigned) const;
void check_size();
+ unsigned get_attachment_index(FramebufferAttachment);
public:
void attach(FramebufferAttachment attch, Renderbuffer &rbuf);
void attach(FramebufferAttachment attch, Texture2D &tex, unsigned level = 0);
static void unbind();
static Framebuffer &system();
-private:
- unsigned get_attachment_index(FramebufferAttachment);
};
inline BufferBits operator|(BufferBits a, BufferBits b)
the image must be compatible with the defined storage. */
void load_image(const std::string &fn);
+private:
+ void image(const Graphics::Image &);
+
+public:
unsigned get_width() const { return width; }
unsigned get_height() const { return height; }
private:
- void image(const Graphics::Image &);
void get_level_size(unsigned, unsigned &, unsigned &);
};