Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-04-07 22:03:24 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-07 22:03:24 +0300
commit7a75581d92ad1df005f1da23a84a3d0aea20188e (patch)
tree3698c046f5f7c32e67c039e47aa7df933f97cf96 /source/blender/editors/interface/interface_draw.c
parentd6ae3789a1462931f29b523badb5f2173aa83902 (diff)
OpenGL: transition away from GL_QUADS
Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order. Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this. Part of T49043
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r--source/blender/editors/interface/interface_draw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 89d9fe992ba..5e4cb9c1ba1 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1195,7 +1195,7 @@ static void ui_draw_colorband_handle_tri(unsigned int pos, float x1, float y1, f
static void ui_draw_colorband_handle_box(unsigned int pos, float x1, float y1, float x2, float y2, bool fill)
{
- immBegin(fill ? GL_QUADS : GL_LINE_LOOP, 4);
+ immBegin(fill ? PRIM_TRIANGLE_FAN : PRIM_LINE_LOOP, 4);
immVertex2f(pos, x1, y1);
immVertex2f(pos, x1, y2);
immVertex2f(pos, x2, y2);
@@ -1916,6 +1916,9 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol
/* ****************************************************** */
+/* TODO: high quality UI drop shadows using GLSL shader and single draw call
+ * would replace / modify the following 3 functions - merwin
+ */
static void ui_shadowbox(unsigned pos, unsigned color, float minx, float miny, float maxx, float maxy, float shadsize, unsigned char alpha)
{
@@ -1954,7 +1957,7 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx,
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
- immBegin(GL_QUADS, 36);
+ immBegin(PRIM_QUADS_XXX, 36);
/* accumulated outline boxes to make shade not linear, is more pleasant */
ui_shadowbox(pos, color, minx, miny, maxx, maxy, 11.0, (20 * alpha) >> 8);