[Bf-blender-cvs] [457934c2479] greasepencil-object: Replace gl* functions by GPU*
Antonio Vazquez
noreply at git.blender.org
Wed Jul 11 10:01:24 CEST 2018
Commit: 457934c2479bc4f158d4ab8595066d0d933626a7
Author: Antonio Vazquez
Date: Wed Jul 11 10:01:11 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB457934c2479bc4f158d4ab8595066d0d933626a7
Replace gl* functions by GPU*
===================================================================
M source/blender/editors/gpencil/annotate_paint.c
===================================================================
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 6958e0fe476..1811a1a5bfd 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -70,6 +70,7 @@
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
+#include "GPU_state.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -1481,9 +1482,9 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr)
const uint shdr_pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ GPU_line_smooth(true);
+ GPU_blend(true);
+ GPU_blend_set_func_separate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
immUniformColor4ub(255, 100, 100, 20);
imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40);
@@ -1508,8 +1509,8 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr)
immUnbindProgram();
- glDisable(GL_BLEND);
- glDisable(GL_LINE_SMOOTH);
+ GPU_blend(false);
+ GPU_line_smooth(false);
}
}
More information about the Bf-blender-cvs
mailing list