Add try/catch blocks around the rendering to detect excess of texture units (closes #427)

This commit is contained in:
Alexander Bock
2017-12-11 23:48:56 -05:00
parent a631b7e0a3
commit c321d76b3e

View File

@@ -351,25 +351,34 @@ void mainRenderFunc() {
}
#endif
OsEng.render(
SgctEngine->getModelMatrix(),
viewMatrix,
projectionMatrix
);
try {
OsEng.render(
SgctEngine->getModelMatrix(),
viewMatrix,
projectionMatrix
);
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
}
LTRACE("main::mainRenderFunc(end)");
}
void mainDraw2DFunc() {
LTRACE("main::mainDraw2DFunc(begin)");
OsEng.drawOverlays();
try {
OsEng.drawOverlays();
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
}
// SGCT gets angry if we change this in our function
glEnable(GL_BLEND);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
LTRACE("main::mainDraw2DFunc(end)");
}