diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2015-12-26 00:57:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-27 00:15:23 +0300 |
commit | 700c40e2f9b59b7e780429fdc10fb0d2d5d117a1 (patch) | |
tree | 8a6ed722fba1e652fe9756276c83da3467f396aa /source/blender/editors/uvedit | |
parent | 58cf3327e481cea3dbd2c1c0b89b02d4d2ca7be4 (diff) |
OpenGL: stipple support added to basic GLSL shader
The is intended to replace the deprecated glPolygonStipple() calls with a shader
based alternative, once we switch over to GLSL shaders.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D1688
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index f4eed3e1fda..34f59b56fff 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -65,6 +65,8 @@ #include "uvedit_intern.h" +#include "GPU_basic_shader.h" + /* use editmesh tessface */ #define USE_EDBM_LOOPTRIS @@ -637,8 +639,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) if (tf == activetf) { /* only once */ - 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); UI_ThemeColor4(TH_EDITMESH_ACTIVE); } else { @@ -650,7 +652,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glEnd(); if (tf == activetf) { - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } } else { @@ -713,8 +715,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); UI_ThemeColor4(TH_EDITMESH_ACTIVE); - 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); glBegin(GL_POLYGON); BM_ITER_ELEM (l, &liter, activef, BM_LOOPS_OF_FACE) { @@ -723,7 +725,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) } glEnd(); - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); glDisable(GL_BLEND); } } |