From: Mikko Rasa Date: Sat, 13 Aug 2016 15:28:47 +0000 (+0300) Subject: Implement the previously forgotten Clipping::unbind X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=aa519211e367bf9b24b8754fcd3cb5ac0f6476d2;p=libs%2Fgl.git Implement the previously forgotten Clipping::unbind --- diff --git a/source/clipping.cpp b/source/clipping.cpp index add7bba6..e309df58 100644 --- a/source/clipping.cpp +++ b/source/clipping.cpp @@ -99,6 +99,22 @@ void Clipping::bind(bool legacy) const void Clipping::unbind() { + const Clipping *old = current(); + if(!set_current(0)) + return; + + if(bound_with_legacy) + { + for(unsigned i=0; iplanes.size(); ++i) + if(old->planes[i]) + ClipPlane::unbind_from(i); + } + else + { + for(unsigned i=0; iplanes.size(); ++i) + if(old->planes[i]) + disable(GL_CLIP_PLANE0+i); + } } } // namespace GL