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

Method bindPointsPicker_

source/MRViewer/MRRenderPointsObject.cpp:308–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308void RenderPointsObject::bindPointsPicker_()
309{
310 MR_TIMER;
311 auto shader = GLStaticHolder::getShaderId( GLStaticHolder::Picker );
312 GL_EXEC( glBindVertexArray( pointsPickerArrayObjId_ ) );
313 GL_EXEC( glUseProgram( shader ) );
314 if ( objPoints_->hasVisualRepresentation() )
315 {
316 const auto positions = loadVertPosBuffer_();
317 bindVertexAttribArray( shader, "position", vertPosBuffer_, positions, 3, positions.dirty(), positions.glSize() != 0 );
318 }
319 else
320 bindVertexAttribArray( shader, "position", vertPosBuffer_, std::vector<Vector3f>{}, 3, false, vertPosBuffer_.size() != 0 );
321
322 auto validIndices = loadValidIndicesBuffer_();
323 validIndicesBuffer_.loadDataOpt( GL_ELEMENT_ARRAY_BUFFER, validIndices.dirty(), validIndices );
324 dirty_ &= ~DIRTY_POSITION;
325}
326
327void RenderPointsObject::initBuffers_()
328{

Callers

nothing calls this directly

Calls 6

dirtyMethod · 0.80
glSizeMethod · 0.80
bindVertexAttribArrayFunction · 0.70
sizeMethod · 0.45
loadDataOptMethod · 0.45

Tested by

no test coverage detected