From: kgv Date: Fri, 29 Jan 2021 02:29:50 +0000 (+0300) Subject: 0032094: Visualization, TKOpenGl - OpenGl_VertexBuffer::bindAttribute() silently... X-Git-Tag: V7_6_0_beta~285 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FIR-2021-01-29;p=occt.git 0032094: Visualization, TKOpenGl - OpenGl_VertexBuffer::bindAttribute() silently does nothing without active GLSL program OpenGl_VertexBuffer::bindAttribute() now prints an error message indicating a possible VBO misuse. --- diff --git a/src/OpenGl/OpenGl_VertexBuffer.lxx b/src/OpenGl/OpenGl_VertexBuffer.lxx index acd5c73541..78ae2f2f5f 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.lxx +++ b/src/OpenGl/OpenGl_VertexBuffer.lxx @@ -30,7 +30,13 @@ inline void OpenGl_VertexBuffer::bindAttribute (const Handle(OpenGl_Context)& { bindFixed (theCtx, theAttribute, theNbComp, theDataType, theStride, theOffset); } + else #endif + { + // OpenGL handles vertex attribute setup independently from active GLSL program, + // but OCCT historically requires program to be bound beforehand (this check could be removed in future). + Message::SendFail ("Error: OpenGl_VertexBuffer::bindAttribute() does nothing without active GLSL program"); + } return; }