From: Mikko Rasa Date: Sun, 14 Aug 2016 08:45:56 +0000 (+0300) Subject: Fully unbind Clipping when legacy mode changes X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=cbe25a3e47751de84a3cee9a2a1f5e246790fde0 Fully unbind Clipping when legacy mode changes Failing to do so may leave ClipPlanes bound to ClipUnits, leading to undesirable behaviour later on. --- diff --git a/source/clipping.cpp b/source/clipping.cpp index 487eeca6..430a7b6f 100644 --- a/source/clipping.cpp +++ b/source/clipping.cpp @@ -57,9 +57,12 @@ void Clipping::bind(bool legacy) const { if(legacy) static Require _req(MSP_legacy_features); + + if(legacy!=bound_with_legacy) + unbind(); const Clipping *old = current(); - if(!set_current(this) && !(legacy && !bound_with_legacy)) + if(!set_current(this)) return; bound_with_legacy = legacy;