vector<GLenum> color_bufs;
color_bufs.reserve(format.size());
unsigned i = 0;
- for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
+ for(FrameAttachment a: format)
{
- GLenum gl_attach_point = get_gl_attachment(static_cast<FrameAttachment>(*j));
+ GLenum gl_attach_point = get_gl_attachment(a);
if(dirty&(1<<i))
{
const Attachment &attch = attachments[i];
if(gl_attach_point!=GL_DEPTH_ATTACHMENT && gl_attach_point!=GL_STENCIL_ATTACHMENT)
color_bufs.push_back(gl_attach_point);
+
+ ++i;
}
if(color_bufs.size()>1)
throw incompatible_data("Framebuffer::attach");
unsigned i = 0;
- for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
- if(*j==attch)
+ for(FrameAttachment a: format)
+ {
+ if(a==attch)
{
attachments[i].set(tex, level, layer);
dirty |= 1<<i;
check_size();
return;
}
+ ++i;
+ }
throw incompatible_data("Framebuffer::attach");
}