Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image.c
| Show First 20 Lines • Show All 412 Lines • ▼ Show 20 Lines | static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customdata) | ||||
| if (pop) { | if (pop) { | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(true); | GPU_blend(true); | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| ARegion *ar = pop->vc.ar; | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| GPU_line_width(4.0); | GPU_line_width(4.0); | ||||
| immUniformColor4ub(0, 0, 0, 255); | immUniformColor4ub(0, 0, 0, 255); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2i(pos, x, y); | immVertex2i(pos, x, y); | ||||
| immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]); | immVertex2i(pos, pop->startmouse[0] + ar->winrct.xmin, pop->startmouse[1] + ar->winrct.ymin); | ||||
| immEnd(); | immEnd(); | ||||
| GPU_line_width(2.0); | GPU_line_width(2.0); | ||||
| immUniformColor4ub(255, 255, 255, 255); | immUniformColor4ub(255, 255, 255, 255); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2i(pos, x, y); | immVertex2i(pos, x, y); | ||||
| immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]); | immVertex2i(pos, pop->startmouse[0] + ar->winrct.xmin, pop->startmouse[1] + ar->winrct.ymin); | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| GPU_blend(false); | GPU_blend(false); | ||||
| GPU_line_smooth(false); | GPU_line_smooth(false); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 834 Lines • Show Last 20 Lines | |||||