OpenGL anti-aliasing for 3D view, user selectable
[blender.git] / source / blender / editors / space_view3d / view3d_draw.c
index bd196718c50c9a8475cd1a290bbb8f216df2a4f9..93eaace3cef57312d9ef2e75d1c2fae35c6429c6 100644 (file)
@@ -2040,6 +2040,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
        Object *obact = OBACT;
        char *grid_unit= NULL;
        
+       /* enables anti-aliasing for 3D view drawing */
+       if (!(U.gameflags & USER_DISABLE_AA))
+               glEnable(GL_MULTISAMPLE_ARB);
+       
        /* from now on all object derived meshes check this */
        v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), scene, obact);
        
@@ -2222,6 +2226,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
        /* XXX here was the blockhandlers for floating panels */
 
        v3d->flag |= V3D_INVALID_BACKBUF;
+       
+       /* Disable back anti-aliasing */
+       if (!(U.gameflags & USER_DISABLE_AA))
+               glDisable(GL_MULTISAMPLE_ARB);
 }