src/ui/canvas.cpp

changeset 119
24275a4064f4
parent 118
8e1c9f18ae15
child 120
8c9fff699241
equal deleted inserted replaced
118:8e1c9f18ae15 119:24275a4064f4
159 glEnable(GL_LINE_SMOOTH); 159 glEnable(GL_LINE_SMOOTH);
160 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); 160 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
161 this->axesProgram->draw(); 161 this->axesProgram->draw();
162 glDisable(GL_LINE_SMOOTH); 162 glDisable(GL_LINE_SMOOTH);
163 } 163 }
164 // Render vertices
165 {
166 glLineWidth(2);
167 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
168 glEnable(GL_LINE_SMOOTH);
169 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
170 this->vertexProgram->draw();
171 glDisable(GL_LINE_SMOOTH);
172 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
173 }
164 // Render grid 174 // Render grid
165 { 175 {
166 glEnable(GL_BLEND); 176 glEnable(GL_BLEND);
167 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 177 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
168 this->gridProgram->draw(); 178 this->gridProgram->draw();
169 glDisable(GL_BLEND); 179 glDisable(GL_BLEND);
170 }
171 // Render vertices
172 {
173 glLineWidth(2);
174 glEnable(GL_LINE_SMOOTH);
175 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
176 this->vertexProgram->draw();
177 glDisable(GL_LINE_SMOOTH);
178 } 180 }
179 if (this->worldPosition.has_value()) 181 if (this->worldPosition.has_value())
180 { 182 {
181 QPainter painter{this}; 183 QPainter painter{this};
182 painter.setRenderHint(QPainter::Antialiasing); 184 painter.setRenderHint(QPainter::Antialiasing);

mercurial