Commit c0110908 authored by Philip Trettner's avatar Philip Trettner

fixed auto viewport without attachements

parent e28e6c98
......@@ -247,7 +247,8 @@ bool BoundFramebuffer::isCurrent() const
void BoundFramebuffer::updateViewport()
{
tg::isize3 dim(32 * 1024);
auto sentinel = tg::max<int>();
auto dim = tg::isize3(sentinel);
if (buffer->mDepthAttachment.texture)
dim = tg::min(dim, buffer->mDepthAttachment.texture->getDimensions());
if (buffer->mStencilAttachment.texture)
......@@ -255,7 +256,8 @@ void BoundFramebuffer::updateViewport()
for (auto const& a : buffer->mColorAttachments)
if (a.texture)
dim = tg::min(dim, a.texture->getDimensions());
glViewport(0, 0, dim.width, dim.height);
if (dim != tg::isize3(sentinel)) // at least one texture
glViewport(0, 0, dim.width, dim.height);
}
bool BoundFramebuffer::checkComplete()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment