0032094: Visualization, TKOpenGl - OpenGl_VertexBuffer::bindAttribute() silently... IR-2021-01-29
authorkgv <kgv@opencascade.com>
Fri, 29 Jan 2021 02:29:50 +0000 (05:29 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 29 Jan 2021 16:54:31 +0000 (19:54 +0300)
OpenGl_VertexBuffer::bindAttribute() now prints an error message indicating a possible VBO misuse.

src/OpenGl/OpenGl_VertexBuffer.lxx

index acd5c73..78ae2f2 100644 (file)
@@ -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;
   }