1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
kgv
60952ca959 0027257: Visualization, TKOpenGl - bind integer vertex attributes 2016-03-14 13:05:36 +03:00
2 changed files with 10 additions and 2 deletions

View 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>

View 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)