]> OCCT Git - occt-copy.git/commitdiff
0027257: Visualization, TKOpenGl - bind integer vertex attributes CR27257
authorkgv <kgv@opencascade.com>
Mon, 14 Mar 2016 10:05:36 +0000 (13:05 +0300)
committerkgv <kgv@opencascade.com>
Mon, 14 Mar 2016 10:05:36 +0000 (13:05 +0300)
src/OpenGl/OpenGl_VertexBuffer.hxx
src/OpenGl/OpenGl_VertexBuffer.lxx

index decacec95916d1ae4764281ab6dc2283a7c0a501..6944de51d8dcd3aea4e12636c1b8b500fe23d038 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef _OpenGl_VertexBuffer_H__
 #define _OpenGl_VertexBuffer_H__
 
-#include <OpenGl_GlCore20.hxx>
+#include <OpenGl_GlCore32.hxx>
 #include <OpenGl_Resource.hxx>
 #include <OpenGl_Context.hxx>
 #include <OpenGl_ShaderProgram.hxx>
index 5545c4a62dfbfc5834e5fedb4b5459bf8c316035..f6ae02a4ac685db2ae897ea2f334a43be64a6d1c 100644 (file)
@@ -35,7 +35,15 @@ inline void OpenGl_VertexBuffer::bindAttribute (const Handle(OpenGl_Context)&
   }
 
   theCtx->core20fwd->glEnableVertexAttribArray (theAttribute);
-  theCtx->core20fwd->glVertexAttribPointer (theAttribute, theNbComp, theDataType, theDataType != GL_FLOAT, theStride, theOffset);
+  if (theDataType == GL_UNSIGNED_INT
+   && theCtx->core32 != NULL)
+  {
+    theCtx->core32->glVertexAttribIPointer (theAttribute, theNbComp, theDataType, theStride, theOffset);
+  }
+  else
+  {
+    theCtx->core20fwd->glVertexAttribPointer (theAttribute, theNbComp, theDataType, theDataType != GL_FLOAT, theStride, theOffset);
+  }
 }
 
 #if !defined(GL_ES_VERSION_2_0)