#include <OpenGl_ShaderManager.hxx>
#include <OpenGl_ShaderProgram.hxx>
#include <OpenGl_ShaderStates.hxx>
-#include <OpenGl_Sampler.hxx>
#include <OpenGl_Text.hxx>
#include <OpenGl_Utils.hxx>
#include <OpenGl_Workspace.hxx>
const OpenGl_AspectText* aTextAspect = theWorkspace->AspectText (Standard_True);
const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture();
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
- const Handle(OpenGl_Sampler)& aSampler = aCtx->TextureSampler();
- if (!aSampler.IsNull())
- {
- aSampler->Unbind (*aCtx);
- }
if (aCtx->IsGlGreaterEqual (2, 0))
{
}
// restore aspects
- if (!aSampler.IsNull())
- {
- aSampler->Bind (*aCtx);
- }
if (!aPrevTexture.IsNull())
{
theWorkspace->EnableTexture (aPrevTexture);
theCtx->core15fwd->glActiveTexture (GL_TEXTURE0);
}
- // unbind current OpenGL sampler
- const Handle(OpenGl_Sampler)& aSampler = theCtx->TextureSampler();
- if (!aSampler.IsNull() && aSampler->IsValid())
- {
- aSampler->Unbind (*theCtx);
- }
-
// extra drawings
switch (theTextAspect.DisplayType())
{
// model view matrix was modified
theCtx->WorldViewState.Pop();
theCtx->ApplyModelViewMatrix();
-
- // revert custom OpenGL sampler
- if (!aSampler.IsNull() && aSampler->IsValid())
- {
- aSampler->Bind (*theCtx);
- }
#endif
}
return myTextureBound;
}
+ const Handle(OpenGl_Sampler)& aSampler = myGlContext->TextureSampler();
+ if (!aSampler.IsNull())
+ {
+ aSampler->Unbind (*myGlContext);
+ }
+
#if !defined(GL_ES_VERSION_2_0)
// reset texture matrix because some code may expect it is identity
GLint aMatrixMode = GL_TEXTURE;