MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / bindLabel_

Method bindLabel_

source/MRViewer/MRRenderLabelObject.cpp:393–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393void RenderLabelObject::bindLabel_()
394{
395 auto shader = GLStaticHolder::getShaderId( GLStaticHolder::Labels );
396 GL_EXEC( glBindVertexArray( labelArrayObjId_ ) );
397 GL_EXEC( glUseProgram( shader ) );
398 if ( auto mesh = objLabel_->labelRepresentingMesh() )
399 bindVertexAttribArray( shader, "position", vertPosBuffer_, mesh->points.vec_, 3, dirty_ & DIRTY_POSITION );
400 else
401 bindVertexAttribArray( shader, "position", vertPosBuffer_, std::vector<Vector3f>{}, 3, false, vertPosBuffer_.valid() );
402
403 auto faceIndices = loadFaceIndicesBuffer_();
404 facesIndicesBuffer_.loadDataOpt( GL_ELEMENT_ARRAY_BUFFER, faceIndices.dirty(), faceIndices );
405 dirty_ &= ~DIRTY_MESH;
406}
407
408void RenderLabelObject::initBuffers_()
409{

Callers

nothing calls this directly

Calls 4

dirtyMethod · 0.80
bindVertexAttribArrayFunction · 0.70
validMethod · 0.45
loadDataOptMethod · 0.45

Tested by

no test coverage detected