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

Method bindPoints_

source/MRViewer/MRRenderMeshObject.cpp:652–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652void RenderMeshObject::bindPoints_( GLStaticHolder::ShaderType shaderType )
653{
654 auto shader = GLStaticHolder::getShaderId( shaderType );
655 GL_EXEC( glBindVertexArray( pointsArrayObjId_ ) );
656 GL_EXEC( glUseProgram( shader ) );
657
658 const auto positions = loadVertPosBuffer_();
659 bindVertexAttribArray( shader, "position", vertPosBuffer_, positions, 3, positions.dirty(), positions.glSize() != 0 );
660
661 const auto normals = loadVertNormalsBuffer_();
662 bindVertexAttribArray( shader, "normal", vertNormalsBuffer_, normals, 3, normals.dirty(), normals.glSize() != 0 );
663
664 const auto colors = loadVertColorsBuffer_();
665 bindVertexAttribArray( shader, "K", vertColorsBuffer_, colors, 4, colors.dirty(), colors.glSize() != 0 );
666
667 auto validIndices = loadPointValidIndicesBuffer_();
668 pointValidBuffer_.loadDataOpt( GL_ELEMENT_ARRAY_BUFFER, validIndices.dirty(), validIndices );
669
670 // VertColors
671 GL_EXEC( glActiveTexture( GL_TEXTURE0 ) );
672 if ( !emptyVertsColorTexture_.valid() )
673 emptyVertsColorTexture_.gen();
674 emptyVertsColorTexture_.bind();
675 GL_EXEC( glUniform1i( glGetUniformLocation( shader, "selection" ), 0 ) );
676
677 dirtyPointPos_ = false;
678}
679
680void RenderMeshObject::drawMesh_( bool /*solid*/, ViewportId viewportId, bool picker ) const
681{

Callers

nothing calls this directly

Calls 7

dirtyMethod · 0.80
glSizeMethod · 0.80
bindVertexAttribArrayFunction · 0.70
loadDataOptMethod · 0.45
validMethod · 0.45
genMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected