diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-16 19:25:42 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-16 19:25:42 +0300 |
commit | 7041b99b5a90509f215db83feeca900d123932b2 (patch) | |
tree | 85f0c6d07ae4b4e738d985c7481a2351caad71e8 /source/blender/windowmanager | |
parent | bf441fcfacc1648cb5aff87dafd1e5f0098e3d2b (diff) |
use immUniformColor instead of immUniform("color"
The specialized color functions are better in every way:
- faster lookup (don't have to match "color" string)
- flexible inputs (RGB with separate alpha)
- automatic alpha = 1.0 if not specified
Sort of related to T49043
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 277a219ca5c..afad1895417 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -226,7 +226,7 @@ static void wm_gesture_draw_rect(wmGesture *gt) glEnable(GL_BLEND); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniform4f("color", 1.0f, 1.0f, 1.0f, 0.05f); + immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f); immRecti(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d32e615d564..a44d1b60a7b 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3089,7 +3089,7 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_MASK_UNIFORM_COLOR); - immUniform4f("color", col[0], col[1], col[2], alpha); + immUniformColor3fvAlpha(col, alpha); immUniform1i("image", GL_TEXTURE0); /* set up rotation if available */ @@ -3208,7 +3208,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniformColor3fvAlpha(col, 0.5); + immUniformColor3fvAlpha(col, 0.5f); if (rc->subtype == PROP_ANGLE) { gpuPushMatrix(); |