only change pass parameters if we actually need to

This commit is contained in:
Konstantin Käfer
2014-05-28 09:47:55 +02:00
parent 90d02ae673
commit e304f6629f
4 changed files with 12 additions and 14 deletions

View File

@@ -144,15 +144,19 @@ void Painter::clear() {
}
void Painter::setOpaque() {
pass = Opaque;
glDisable(GL_BLEND);
depthMask(true);
if (pass != Opaque) {
pass = Opaque;
glDisable(GL_BLEND);
depthMask(true);
}
}
void Painter::setTranslucent() {
pass = Translucent;
glEnable(GL_BLEND);
depthMask(false);
if (pass != Translucent) {
pass = Translucent;
glEnable(GL_BLEND);
depthMask(false);
}
}
void Painter::setStrata(float value) {