From 2ff309590e02fed1efce32b1f288cc2d36de827b Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Mon, 23 Jun 2008 00:48:19 -0800 Subject: [PATCH] Oops, was calling glBegin() once for each triangle when showing mesh! [git-p4: depot-paths = "//depot/solvespace/": change = 1807] --- glhelper.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/glhelper.cpp b/glhelper.cpp index 9234c4d9..86d84daa 100644 --- a/glhelper.cpp +++ b/glhelper.cpp @@ -312,20 +312,20 @@ void glxDebugMesh(SMesh *m) glPointSize(7); glxDepthRangeOffset(1); glxUnlockColor(); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glxColor4d(0, 1, 0, 1.0); + glBegin(GL_TRIANGLES); for(i = 0; i < m->l.n; i++) { STriangle *t = &(m->l.elem[i]); if(t->tag) continue; - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glxColor4d(0, 1, 0, 1.0); - glBegin(GL_TRIANGLES); - glxVertex3v(t->a); - glxVertex3v(t->b); - glxVertex3v(t->c); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glxVertex3v(t->a); + glxVertex3v(t->b); + glxVertex3v(t->c); } + glEnd(); glxDepthRangeOffset(0); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } void glxMarkPolygonNormal(SPolygon *p)