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/windowmanager/intern/wm_gesture.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/windowmanager/intern/wm_gesture.c')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index c97995637a2..460b4ac3b6d 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -221,22 +221,14 @@ static void wm_gesture_draw_rect(wmGesture *gt)
rcti *rect = (rcti *)gt->customdata;
VertexFormat *format = immVertexFormat();
- unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT);
- immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-
glEnable(GL_BLEND);
+ immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniform4f("color", 1.0f, 1.0f, 1.0f, 0.05f);
- immBegin(GL_QUADS, 4);
-
- immVertex2f(pos, (float)rect->xmax, (float)rect->ymin);
- immVertex2f(pos, (float)rect->xmax, (float)rect->ymax);
- immVertex2f(pos, (float)rect->xmin, (float)rect->ymax);
- immVertex2f(pos, (float)rect->xmin, (float)rect->ymin);
-
- immEnd();
+ immRecti(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
immUnbindProgram();