Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_cursor.c
| Show First 20 Lines • Show All 909 Lines • ▼ Show 20 Lines | if (brush->paint_curve && brush->paint_curve->points) { | ||||
| PaintCurvePoint *cp = pc->points; | PaintCurvePoint *cp = pc->points; | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| /* Draw the bezier handles and the curve segment between the current and next point. */ | /* Draw the bezier handles and the curve segment between the current and next point. */ | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| float selec_col[4], handle_col[4], pivot_col[4]; | float selec_col[4], handle_col[4], pivot_col[4]; | ||||
| UI_GetThemeColorType4fv(TH_VERTEX_SELECT, SPACE_VIEW3D, selec_col); | UI_GetThemeColorType4fv(TH_VERTEX_SELECT, SPACE_VIEW3D, selec_col); | ||||
| UI_GetThemeColorType4fv(TH_PAINT_CURVE_HANDLE, SPACE_VIEW3D, handle_col); | UI_GetThemeColorType4fv(TH_PAINT_CURVE_HANDLE, SPACE_VIEW3D, handle_col); | ||||
| UI_GetThemeColorType4fv(TH_PAINT_CURVE_PIVOT, SPACE_VIEW3D, pivot_col); | UI_GetThemeColorType4fv(TH_PAINT_CURVE_PIVOT, SPACE_VIEW3D, pivot_col); | ||||
| for (int i = 0; i < pc->tot_points - 1; i++, cp++) { | for (int i = 0; i < pc->tot_points - 1; i++, cp++) { | ||||
| int j; | int j; | ||||
| ▲ Show 20 Lines • Show All 937 Lines • ▼ Show 20 Lines | |||||
| static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext) | static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext) | ||||
| { | { | ||||
| GPU_line_width(2.0f); | GPU_line_width(2.0f); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| pcontext->pos = GPU_vertformat_attr_add( | pcontext->pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| } | } | ||||
| static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext) | static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext) | ||||
| { | { | ||||
| GPU_line_width(2.0f); | GPU_line_width(2.0f); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| pcontext->pos = GPU_vertformat_attr_add( | pcontext->pos = GPU_vertformat_attr_add( | ||||
| ▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines | |||||