throw invalid_operation("Framebuffer::set_format");
if(fmt.empty() || !is_format_supported(fmt))
throw invalid_argument("Framebuffer::set_format");
throw invalid_operation("Framebuffer::set_format");
if(fmt.empty() || !is_format_supported(fmt))
throw invalid_argument("Framebuffer::set_format");
if(const Texture2D *tex2d = dynamic_cast<const Texture2D *>(a.tex))
{
w = max(tex2d->get_width()>>a.level, 1U);
if(const Texture2D *tex2d = dynamic_cast<const Texture2D *>(a.tex))
{
w = max(tex2d->get_width()>>a.level, 1U);
{
w = max(tex3d->get_width()>>a.level, 1U);
h = max(tex3d->get_height()>>a.level, 1U);
{
w = max(tex3d->get_width()>>a.level, 1U);
h = max(tex3d->get_height()>>a.level, 1U);
}
else if(const TextureCube *tex_cube = dynamic_cast<const TextureCube *>(a.tex))
{
w = max(tex_cube->get_size()>>a.level, 1U);
h = w;
}
else if(const TextureCube *tex_cube = dynamic_cast<const TextureCube *>(a.tex))
{
w = max(tex_cube->get_size()>>a.level, 1U);
h = w;
}
}
}
void Framebuffer::set_attachment(FrameAttachment attch, Texture &tex, unsigned level, int layer, unsigned samples)
{
}
}
}
void Framebuffer::set_attachment(FrameAttachment attch, Texture &tex, unsigned level, int layer, unsigned samples)
{
throw invalid_operation("Framebuffer::attach");
if((format.get_samples()>1 && samples!=format.get_samples()) || (format.get_samples()==1 && samples))
throw invalid_operation("Framebuffer::attach");
if((format.get_samples()>1 && samples!=format.get_samples()) || (format.get_samples()==1 && samples))
bool layered = (!attachments.empty() && attachments.front().layer<0);
for(const Attachment &a: attachments)
{
bool layered = (!attachments.empty() && attachments.front().layer<0);
for(const Attachment &a: attachments)
{