From: kgv Date: Mon, 14 Mar 2016 10:05:36 +0000 (+0300) Subject: 0027257: Visualization, TKOpenGl - bind integer vertex attributes X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR27257;p=occt-copy.git 0027257: Visualization, TKOpenGl - bind integer vertex attributes --- diff --git a/src/OpenGl/OpenGl_VertexBuffer.hxx b/src/OpenGl/OpenGl_VertexBuffer.hxx index decacec959..6944de51d8 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.hxx +++ b/src/OpenGl/OpenGl_VertexBuffer.hxx @@ -15,7 +15,7 @@ #ifndef _OpenGl_VertexBuffer_H__ #define _OpenGl_VertexBuffer_H__ -#include +#include #include #include #include diff --git a/src/OpenGl/OpenGl_VertexBuffer.lxx b/src/OpenGl/OpenGl_VertexBuffer.lxx index 5545c4a62d..f6ae02a4ac 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.lxx +++ b/src/OpenGl/OpenGl_VertexBuffer.lxx @@ -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)