Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_paint.c
| Show First 20 Lines • Show All 2,404 Lines • ▼ Show 20 Lines | |||||
| /* Helper callback for drawing the cursor itself */ | /* Helper callback for drawing the cursor itself */ | ||||
| static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) | static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) | ||||
| { | { | ||||
| tGPsdata *p = (tGPsdata *)p_ptr; | tGPsdata *p = (tGPsdata *)p_ptr; | ||||
| if (p->paintmode == GP_PAINTMODE_ERASER) { | if (p->paintmode == GP_PAINTMODE_ERASER) { | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| const uint shdr_pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | const uint shdr_pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immUniformColor4ub(255, 100, 100, 20); | immUniformColor4ub(255, 100, 100, 20); | ||||
| imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); | imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ▲ Show 20 Lines • Show All 1,621 Lines • Show Last 20 Lines | |||||