attempt to fix [#21179] r26939 - Lasso tool does not work when drawing counter clock...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 1 Oct 2010 07:49:00 +0000 (07:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 1 Oct 2010 07:49:00 +0000 (07:49 +0000)
can't test this so guessing this is caused by face culling.

source/blender/editors/mesh/editmesh_mods.c

index 799cca2..5a33d60 100644 (file)
@@ -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;
        
 }