fix for editmode opengl drawing (bug from own recent optimization), need to set glShadeModel() outside glBegin(GL_QUADS / GL_TRIANGLES).

This commit is contained in:
Campbell Barton
2011-10-09 23:04:31 +00:00
parent 17b66b46ad
commit 39c4e3ae3c

View File

@@ -697,9 +697,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else { else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
if (shade_type != shade_prev) { if (shade_type != shade_prev) {
glShadeModel((shade_prev= shade_type)); if(poly_prev != GL_ZERO) glEnd();
glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */
glBegin((poly_prev= poly_type));
} }
if(poly_type != poly_prev) { else if(poly_type != poly_prev) {
if(poly_prev != GL_ZERO) glEnd(); if(poly_prev != GL_ZERO) glEnd();
glBegin((poly_prev= poly_type)); glBegin((poly_prev= poly_type));
} }
@@ -762,9 +764,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else { else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
if (shade_type != shade_prev) { if (shade_type != shade_prev) {
glShadeModel((shade_prev= shade_type)); if(poly_prev != GL_ZERO) glEnd();
glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */
glBegin((poly_prev= poly_type));
} }
if(poly_type != poly_prev) { else if(poly_type != poly_prev) {
if(poly_prev != GL_ZERO) glEnd(); if(poly_prev != GL_ZERO) glEnd();
glBegin((poly_prev= poly_type)); glBegin((poly_prev= poly_type));
} }