+ const Framebuffer *target_fbo = renderer.get_framebuffer();
+ if(!target_fbo)
+ throw invalid_operation("Sequence::render");
+
+ const FrameFormat &format = target_fbo->get_format();
+ ClearValue clear_values[7];
+ unsigned i = 0;
+ Color default_color = (clear_colors.empty() ? Color(0.0f, 0.0f, 0.0f, 0.0f) : clear_colors.front());
+ ClearValue *cv = clear_values;
+ for(FrameAttachment a: format)
+ {
+ if(get_attach_point(a)==get_attach_point(DEPTH_ATTACHMENT))
+ cv->depth_stencil.depth = clear_depth;
+ else if(get_attach_point(a)==get_attach_point(STENCIL_ATTACHMENT))
+ cv->depth_stencil.stencil = clear_stencil;
+ else
+ cv->color = (i<clear_colors.size() ? clear_colors[i++] : default_color);
+ ++cv;
+ }
+
+ renderer.clear(clear_values);