File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ bool COpenGLDriver::updateHardwareBuffer(SHWBufferLink *HWBuffer)
388388 return false ;
389389 b->ChangedID = vb->getChangedID ();
390390 }
391- } else if (auto *ib = dynamic_cast <const scene::IVertexBuffer *>(b->Buffer )) {
391+ } else if (auto *ib = dynamic_cast <const scene::IIndexBuffer *>(b->Buffer )) {
392392 if (b->ChangedID != ib->getChangedID () || !b->vbo_ID ) {
393393 if (!updateIndexHardwareBuffer (b))
394394 return false ;
@@ -445,17 +445,17 @@ void COpenGLDriver::drawBuffers(const scene::IVertexBuffer *vb,
445445#if defined(GL_ARB_vertex_buffer_object)
446446 auto *hwvert = static_cast <SHWBufferLink_opengl *>(getBufferLink (vb));
447447 auto *hwidx = static_cast <SHWBufferLink_opengl *>(getBufferLink (ib));
448- updateHardwareBuffer (hwvert);
449- updateHardwareBuffer (hwidx);
450448
451449 const void *vertices = vb->getData ();
452450 if (hwvert) {
451+ updateHardwareBuffer (hwvert);
453452 extGlBindBuffer (GL_ARRAY_BUFFER, hwvert->vbo_ID );
454453 vertices = 0 ;
455454 }
456455
457456 const void *indexList = ib->getData ();
458457 if (hwidx) {
458+ updateHardwareBuffer (hwidx);
459459 extGlBindBuffer (GL_ELEMENT_ARRAY_BUFFER, hwidx->vbo_ID );
460460 indexList = 0 ;
461461 }
You can’t perform that action at this time.
0 commit comments