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
This commit is contained in:
2015-12-25 22:57:50 +01:00
committed by Brecht Van Lommel
parent 58cf3327e4
commit 700c40e2f9
14 changed files with 457 additions and 206 deletions

View File

@@ -57,6 +57,8 @@
#include "interface_intern.h"
#include "GPU_basic_shader.h"
#ifdef WITH_INPUT_IME
# include "WM_types.h"
#endif
@@ -660,14 +662,14 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glDrawArrays(GL_POLYGON, 0, wtb->totvert);
/* light checkers */
glEnable(GL_POLYGON_STIPPLE);
GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
glColor4ub(UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, 255);
glPolygonStipple(stipple_checker_8px);
GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_CHECKER_8PX);
glVertexPointer(2, GL_FLOAT, 0, wtb->inner_v);
glDrawArrays(GL_POLYGON, 0, wtb->totvert);
glDisable(GL_POLYGON_STIPPLE);
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
/* alpha fill */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);