X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FOpenGl%2FOpenGl_VertexBuffer.lxx;h=acd5c73541aad633d22ac457b3f869681bc8a2a2;hp=fb11b4887d08a2c02bfb6713ad823b78d021575a;hb=0c33a0bf4d320a4afef435687477636a570100b3;hpb=ca3c13d1e8415e0b7a6d9ec2955b4807a813f290 diff --git a/src/OpenGl/OpenGl_VertexBuffer.lxx b/src/OpenGl/OpenGl_VertexBuffer.lxx index fb11b4887d..acd5c73541 100644 --- a/src/OpenGl/OpenGl_VertexBuffer.lxx +++ b/src/OpenGl/OpenGl_VertexBuffer.lxx @@ -26,13 +26,16 @@ inline void OpenGl_VertexBuffer::bindAttribute (const Handle(OpenGl_Context)& if (theCtx->ActiveProgram().IsNull()) { #if !defined(GL_ES_VERSION_2_0) - bindFixed (theCtx, theAttribute, theNbComp, theDataType, theStride, theOffset); + if (theCtx->core11 != NULL) + { + bindFixed (theCtx, theAttribute, theNbComp, theDataType, theStride, theOffset); + } #endif return; } theCtx->core20fwd->glEnableVertexAttribArray (theAttribute); - theCtx->core20fwd->glVertexAttribPointer (theAttribute, theNbComp, theDataType, GL_FALSE, theStride, theOffset); + theCtx->core20fwd->glVertexAttribPointer (theAttribute, theNbComp, theDataType, theDataType != GL_FLOAT, theStride, theOffset); } #if !defined(GL_ES_VERSION_2_0) @@ -93,7 +96,10 @@ inline void OpenGl_VertexBuffer::unbindAttribute (const Handle(OpenGl_Context)& if (theCtx->ActiveProgram().IsNull()) { #if !defined(GL_ES_VERSION_2_0) - unbindFixed (theCtx, theAttribute); + if (theCtx->core11 != NULL) + { + unbindFixed (theCtx, theAttribute); + } #endif return; } @@ -103,7 +109,7 @@ inline void OpenGl_VertexBuffer::unbindAttribute (const Handle(OpenGl_Context)& #if !defined(GL_ES_VERSION_2_0) // ======================================================================= -// function : unbindAttribute +// function : unbindFixed // purpose : // ======================================================================= inline void OpenGl_VertexBuffer::unbindFixed (const Handle(OpenGl_Context)& theCtx, @@ -114,12 +120,7 @@ inline void OpenGl_VertexBuffer::unbindFixed (const Handle(OpenGl_Context)& th case Graphic3d_TOA_POS: theCtx->core11->glDisableClientState (GL_VERTEX_ARRAY); return; case Graphic3d_TOA_NORM: theCtx->core11->glDisableClientState (GL_NORMAL_ARRAY); return; case Graphic3d_TOA_UV: theCtx->core11->glDisableClientState (GL_TEXTURE_COORD_ARRAY); return; - case Graphic3d_TOA_COLOR: - { - theCtx->core11->glDisableClientState (GL_COLOR_ARRAY); - theCtx->core11fwd->glDisable (GL_COLOR_MATERIAL); - return; - } + case Graphic3d_TOA_COLOR: unbindFixedColor (theCtx); return; case Graphic3d_TOA_CUSTOM: { return;