[Bf-blender-cvs] [bf83f097ad] blender2.8: Immediate Mode: sculpt_uv.c
Dalai Felinto
noreply at git.blender.org
Wed Feb 15 15:52:34 CET 2017
Commit: bf83f097ad7e31aec9587b198e434861d0ee6b3a
Author: Dalai Felinto
Date: Wed Feb 15 15:50:24 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBbf83f097ad7e31aec9587b198e434861d0ee6b3a
Immediate Mode: sculpt_uv.c
===================================================================
M source/blender/editors/sculpt_paint/sculpt_uv.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index fd2a0b15cb..4d7f069b2a 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -55,6 +55,8 @@
#include "ED_image.h"
#include "ED_mesh.h"
+#include "GPU_immediate.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -212,18 +214,17 @@ static void brush_drawcursor_uvsculpt(bContext *C, int x, int y, void *UNUSED(cu
alpha *= (size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN);
}
- glPushMatrix();
-
- glTranslatef((float)x, (float)y, 0.0f);
+ unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+ immUniformColor3fvAlpha(brush->add_col, alpha);
- glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
- glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size, 40);
+ imm_draw_lined_circle(pos, (float)x, (float)y, size, 40);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
- glPopMatrix();
+ immUnbindProgram();
}
#undef PX_SIZE_FADE_MAX
#undef PX_SIZE_FADE_MIN
More information about the Bf-blender-cvs
mailing list