From ed683678c032b94c52551747f978cd1dfc8224a8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 23 May 2018 07:47:15 +0100 Subject: [PATCH] Added check to make sure that glEnablei and glDisablei are only called when the capability is non zero to fix GL invalid value error. --- src/osg/Capability.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/Capability.cpp b/src/osg/Capability.cpp index 53425bc7b..930e3ad8e 100644 --- a/src/osg/Capability.cpp +++ b/src/osg/Capability.cpp @@ -42,7 +42,7 @@ void Enablei::apply(State& state) const if (extensions->glEnablei) { OSG_INFO<<"extensions->glEnablei("<<_capability<<", "<<_index<<")"<glEnablei(_capability, static_cast(_index)); + if (_capability) extensions->glEnablei(_capability, static_cast(_index)); } else { @@ -56,7 +56,7 @@ void Disablei::apply(State& state) const if (extensions->glDisablei) { OSG_INFO<<"extensions->glDisablei("<<_capability<<", "<<_index<<")"<glDisablei(_capability, static_cast(_index)); + if (_capability) extensions->glDisablei(_capability, static_cast(_index)); } else {