OpenGL: stipple support added to basic GLSL shader
[blender.git] / source / blender / blenkernel / intern / editderivedmesh.c
index dc50e39a8623c7c92aba64c6f789db76446168a0..642a89df8e0e571ca4b4b9ef5f766b29fb302b69 100644 (file)
@@ -57,8 +57,7 @@
 
 #include "GPU_glew.h"
 #include "GPU_shader.h"
-
-extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
+#include "GPU_basic_shader.h"
 
 static void bmdm_get_tri_colpreview(BMLoop *ls[3], MLoopCol *lcol[3], unsigned char(*color_vert_array)[4]);
 
@@ -804,8 +803,8 @@ static void emDM_drawMappedFaces(
                                        if (poly_prev != GL_ZERO) glEnd();
                                        poly_prev = GL_ZERO; /* force glBegin */
 
-                                       glEnable(GL_POLYGON_STIPPLE);
-                                       glPolygonStipple(stipple_quarttone);
+                                       GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
+                                       GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_QUARTTONE);
                                }
 
                                if      (has_vcol_preview) bmdm_get_tri_colpreview(ltri, lcol, color_vert_array);
@@ -867,7 +866,7 @@ static void emDM_drawMappedFaces(
                                        glEnd();
                                        poly_prev = GL_ZERO; /* force glBegin */
 
-                                       glDisable(GL_POLYGON_STIPPLE);
+                                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                                }
                        }
                }
@@ -903,8 +902,8 @@ static void emDM_drawMappedFaces(
                                        if (poly_prev != GL_ZERO) glEnd();
                                        poly_prev = GL_ZERO; /* force glBegin */
 
-                                       glEnable(GL_POLYGON_STIPPLE);
-                                       glPolygonStipple(stipple_quarttone);
+                                       GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
+                                       GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_QUARTTONE);
                                }
 
                                if      (has_vcol_preview) bmdm_get_tri_colpreview(ltri, lcol, color_vert_array);
@@ -968,7 +967,7 @@ static void emDM_drawMappedFaces(
                                        glEnd();
                                        poly_prev = GL_ZERO; /* force glBegin */
 
-                                       glDisable(GL_POLYGON_STIPPLE);
+                                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                                }
                        }
                }