From 60952ca959866ee37c6d7ecd59d193255e9de6fd Mon Sep 17 00:00:00 2001 From: kgv Date: Mon, 14 Mar 2016 13:05:36 +0300 Subject: [PATCH] 0027257: Visualization, TKOpenGl - bind integer vertex attributes --- src/OpenGl/OpenGl_VertexBuffer.hxx | 2 +- src/OpenGl/OpenGl_VertexBuffer.lxx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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) -- 2.39.5