namespace
{
- //! Convert index data type from size
- inline GLenum toGlIndexType (const Standard_Integer theStride)
- {
- switch (theStride)
- {
- case 2: return GL_UNSIGNED_SHORT;
- case 4: return GL_UNSIGNED_INT;
- default: return GL_NONE;
- }
- }
-
//! Convert data type to GL info
inline GLenum toGlDataType (const Graphic3d_TypeOfData theType,
GLint& theNbComp)
}
default:
{
+ const Handle(OpenGl_Texture)& aTexture = theWorkspace->ActiveTexture();
const Standard_Boolean isLightOnFace = isLightOn
- && (theWorkspace->ActiveTexture().IsNull()
- || theWorkspace->ActiveTexture()->GetParams()->IsModulate());
- aCtx->ShaderManager()->BindProgram (anAspectFace, theWorkspace->ActiveTexture(), isLightOnFace, hasVertColor, anAspectFace->ShaderProgramRes (aCtx));
+ && (aTexture.IsNull()
+ || aTexture->GetParams()->IsModulate());
+ aCtx->ShaderManager()->BindProgram (anAspectFace, aTexture, isLightOnFace, hasVertColor, anAspectFace->ShaderProgramRes (aCtx));
break;
}
}
}
+ if (!theWorkspace->ActiveTexture().IsNull()
+ && myDrawMode != GL_POINTS) // transformation is not supported within point sprites
+ {
+ aCtx->SetTextureMatrix (theWorkspace->ActiveTexture()->GetParams());
+ }
+
aCtx->SetColor4fv (*(const OpenGl_Vec4* )(myDrawMode <= GL_LINE_STRIP ? aLineColor->rgb : anInteriorColor->rgb));
if (myDrawMode == GL_LINES
|| myDrawMode == GL_LINE_STRIP)