diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-12-13 23:43:13 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-12-13 23:43:13 +0300 |
commit | 0fa887ae35d50e0941df47a01bac457c6109e65a (patch) | |
tree | d5b340471b68a2a289afa60b736aee241d95a078 /source/blender/editors/screen/area.c | |
parent | 3b98b442235c8f8108d773fe548b1763eb394dde (diff) |
OpenGL: finish area action zone todo
Replace outlined circle (24 vertices) with a point sprite (1 vertex).
Replace one todo with another todo.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 63c152af6ec..2aac9ce0f81 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -58,6 +58,7 @@ #include "ED_space_api.h" #include "GPU_immediate.h" +#include "GPU_draw.h" #include "BIF_gl.h" #include "BIF_glutil.h" @@ -299,25 +300,28 @@ static void region_draw_azone_icon(AZone *az) VertexFormat* format = immVertexFormat(); unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - /* outlined circle */ + GPU_enable_program_point_size(); /* TODO: make a fixed-size shader to avoid this */ + immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH); immUniform4f("color", 1.0f, 1.0f, 1.0f, 0.8f); - imm_draw_filled_circle(pos, midx, midy, 4.25f, 12); - /* TODO(merwin): replace this --^ with one round point once shader is ready */ - glEnable(GL_LINE_SMOOTH); - immUniform4f("color", 0.2f, 0.2f, 0.2f, 0.9f); - imm_draw_lined_circle(pos, midx, midy, 4.25f, 12); - glDisable(GL_LINE_SMOOTH); + immUniform4f("outlineColor", 0.2f, 0.2f, 0.2f, 0.9f); + immUniform1f("outlineWidth", 1.0f); + immUniform1f("size", 9.5f); + immBegin(GL_POINTS, 1); + immVertex2f(pos, midx, midy); + immEnd(); + immUnbindProgram(); + GPU_disable_program_point_size(); /* + */ + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniform4f("color", 0.2f, 0.2f, 0.2f, 0.9f); immBegin(GL_LINES, 4); immVertex2f(pos, midx, midy - 2); immVertex2f(pos, midx, midy + 3); immVertex2f(pos, midx - 2, midy); immVertex2f(pos, midx + 3, midy); immEnd(); - immUnbindProgram(); } |