diff -r 121a40d5e34c -r 8e1c9f18ae15 src/ui/canvas.cpp --- a/src/ui/canvas.cpp Tue Jul 27 13:23:34 2021 +0300 +++ b/src/ui/canvas.cpp Tue Jul 27 16:29:00 2021 +0300 @@ -21,6 +21,15 @@ this->update(); } +void Canvas::rebuildVertices(Document* document) +{ + if (this->vertexProgram.has_value()) + { + this->vertexProgram->build(document); + this->update(); + } +} + void Canvas::mouseMoveEvent(QMouseEvent* event) { const ldraw::id_t id = this->pick(event->pos()); @@ -105,9 +114,12 @@ this->gridProgram->initialize(); this->axesProgram.emplace(this); this->axesProgram->initialize(); + this->vertexProgram.emplace(this); + this->vertexProgram->initialize(); for (AbstractBasicShaderProgram* program : { static_cast(&*this->gridProgram), static_cast(&*this->axesProgram), + static_cast(&*this->vertexProgram), }) { connect(this, &PartRenderer::projectionMatrixChanged, @@ -156,6 +168,14 @@ this->gridProgram->draw(); glDisable(GL_BLEND); } + // Render vertices + { + glLineWidth(2); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + this->vertexProgram->draw(); + glDisable(GL_LINE_SMOOTH); + } if (this->worldPosition.has_value()) { QPainter painter{this};