Skip to content

Commit

Permalink
libgui|GLFramebuffer: Fall back to non-multisampled if an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 24, 2013
1 parent a74e411 commit f895c0d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions doomsday/libgui/src/glframebuffer.cpp
Expand Up @@ -165,16 +165,26 @@ DENG2_PIMPL(GLFramebuffer)

if(isMultisampled())
{
// Set up the multisampled target with suitable renderbuffers.
multisampleTarget.configure(size, GLTarget::ColorDepthStencil, sampleCount());
multisampleTarget.clear(GLTarget::ColorDepthStencil);
try
{
// Set up the multisampled target with suitable renderbuffers.
multisampleTarget.configure(size, GLTarget::ColorDepthStencil, sampleCount());
multisampleTarget.clear(GLTarget::ColorDepthStencil);

// Actual drawing occurs in the multisampled target that is then
// blitted to the main target.
target.setProxy(&multisampleTarget);
// Actual drawing occurs in the multisampled target that is then
// blitted to the main target.
target.setProxy(&multisampleTarget);
}
catch(GLTarget::ConfigError const &er)
{
LOG_WARNING("Multisampling not supported:\n %s") << er.asText();
_samples = 1;
goto noMultisampling;
}
}
else
{
noMultisampling:
multisampleTarget.configure();
}
}
Expand Down

0 comments on commit f895c0d

Please sign in to comment.