From aa519211e367bf9b24b8754fcd3cb5ac0f6476d2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 13 Aug 2016 18:28:47 +0300 Subject: [PATCH] Implement the previously forgotten Clipping::unbind --- source/clipping.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.45.2