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

@ -697,9 +697,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
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();
glBegin((poly_prev= poly_type));
}
@ -762,9 +764,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
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();
glBegin((poly_prev= poly_type));
}