attempt to fix [#21179] r26939 - Lasso tool does not work when drawing counter clock wise

can't test this so guessing this is caused by face culling.
This commit is contained in:
Campbell Barton 2010-10-01 07:49:00 +00:00
parent 3dea67a3fd
commit 65b92821e1

@ -258,6 +258,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s
unsigned int *dr, *drm;
struct ImBuf *buf, *bufmask;
int a;
GLboolean is_cull;
/* method in use for face selecting too */
if(vc->obedit==NULL) {
@ -276,6 +277,10 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s
glDisable(GL_DEPTH_TEST);
glColor3ub(0, 0, 0);
/* some opengl drivers have problems with draw direction */
glGetBooleanv(GL_CULL_FACE, &is_cull);
if(is_cull) glDisable(GL_CULL_FACE);
/* yah, opengl doesn't do concave... tsk! */
ED_region_pixelspace(vc->ar);
@ -302,6 +307,9 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s
}
IMB_freeImBuf(buf);
IMB_freeImBuf(bufmask);
if(is_cull) glEnable(GL_CULL_FACE);
return 1;
}