From 7d11a67a4e69602396976fc16caaf849ceaa9d0e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 10 Jan 2007 15:25:02 +0000 Subject: [PATCH] Bugfix #5487 (among others) glDrawArrays() for a closed line loop (polygon) crashes in some platforms, but why we couldn't find any reason for. Replaced code with regular glBegin() and glEnd(). --- source/blender/src/drawobject.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index b0ccf2c07b2..a39d997a08f 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2327,11 +2327,19 @@ static void drawDispListsolid(ListBase *lb, Object *ob) break; case DL_POLY: if(ob->type==OB_SURF) { + int nr; + BIF_ThemeColor(TH_WIRE); glDisable(GL_LIGHTING); - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glDrawArrays(GL_LINE_LOOP, 0, dl->nr); + /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */ + //glVertexPointer(3, GL_FLOAT, 0, dl->verts); + //glDrawArrays(GL_LINE_LOOP, 0, dl->nr); + + glBegin(GL_LINE_LOOP); + for(nr= dl->nr; nr; nr--, data+=3) + glVertex3fv(data); + glEnd(); glEnable(GL_LIGHTING); break;