src/gl/partrenderer.cpp

changeset 231
a9bf6bab5ea2
parent 217
6d95c1a41e6e
child 232
8efa3a33172e
equal deleted inserted replaced
230:a1f3f7d9078b 231:a9bf6bab5ea2
187 // Lines need to be rendered last so that anti-aliasing does not interfere with polygon rendering. 187 // Lines need to be rendered last so that anti-aliasing does not interfere with polygon rendering.
188 this->renderVao(gl::ArrayClass::Triangles); 188 this->renderVao(gl::ArrayClass::Triangles);
189 this->renderVao(gl::ArrayClass::Quads); 189 this->renderVao(gl::ArrayClass::Quads);
190 this->renderVao(gl::ArrayClass::Lines); 190 this->renderVao(gl::ArrayClass::Lines);
191 }; 191 };
192 if (this->renderPreferences.wireframe and this->renderPreferences.style != gl::RenderStyle::PickScene) {
193 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
194 }
192 switch (this->renderPreferences.style) 195 switch (this->renderPreferences.style)
193 { 196 {
194 case gl::RenderStyle::Normal: 197 case gl::RenderStyle::Normal:
195 this->setFragmentStyle(gl::FragmentStyle::Normal); 198 this->setFragmentStyle(gl::FragmentStyle::Normal);
196 renderAllArrays(); 199 renderAllArrays();
221 case gl::RenderStyle::VertexPickScene: 224 case gl::RenderStyle::VertexPickScene:
222 glLineWidth(1.0f); 225 glLineWidth(1.0f);
223 this->setFragmentStyle(gl::FragmentStyle::Black); 226 this->setFragmentStyle(gl::FragmentStyle::Black);
224 renderAllArrays(); 227 renderAllArrays();
225 break; 228 break;
226 case gl::RenderStyle::Wireframe:
227 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
228 this->setFragmentStyle(gl::FragmentStyle::Normal);
229 renderAllArrays();
230 break;
231 } 229 }
232 glDisable(GL_POLYGON_OFFSET_FILL); 230 glDisable(GL_POLYGON_OFFSET_FILL);
231 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
233 } 232 }
234 233
235 234
236 void PartRenderer::updateViewMatrix() 235 void PartRenderer::updateViewMatrix()
237 { 236 {

mercurial