diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index 1628334a64..3f1bd8191e 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -408,11 +408,11 @@ Handle(OpenGl_Texture) OpenGl_Workspace::EnableTexture (const Handle(OpenGl_Text return DisableTexture(); } - if (myTextureBound.IsNull() && myTextureBound == theTexture) + if (myTextureBound == theTexture + && (theParams.IsNull() || theParams == theTexture->GetParams())) { - Handle(OpenGl_Texture) aPrevTexture = myTextureBound; - myTextureBound = theTexture; - return aPrevTexture; + // already bound + return myTextureBound; } Handle(OpenGl_Texture) aPrevTexture = DisableTexture();