Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_operators.c
| Show First 20 Lines • Show All 2,353 Lines • ▼ Show 20 Lines | if (rc->texture) { | ||||
| /* undo rotation */ | /* undo rotation */ | ||||
| if (rc->rot_prop) { | if (rc->rot_prop) { | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* flat color if no texture available */ | /* flat color if no texture available */ | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor3fvAlpha(col, alpha); | immUniformColor3fvAlpha(col, alpha); | ||||
| imm_draw_circle_fill_2d(pos, 0.0f, 0.0f, radius, 40); | imm_draw_circle_fill_2d(pos, 0.0f, 0.0f, radius, 40); | ||||
| } | } | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| static void radial_control_paint_curve(uint pos, Brush *br, float radius, int line_segments) | static void radial_control_paint_curve(uint pos, Brush *br, float radius, int line_segments) | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void *customdata) | ||||
| /* set line color */ | /* set line color */ | ||||
| if (rc->col_prop) { | if (rc->col_prop) { | ||||
| RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col); | RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col); | ||||
| } | } | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint 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); | ||||
| if (rc->subtype == PROP_ANGLE) { | if (rc->subtype == PROP_ANGLE) { | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| /* draw original angle line */ | /* draw original angle line */ | ||||
| GPU_matrix_rotate_3f(RAD2DEGF(rc->initial_value), 0.0f, 0.0f, 1.0f); | GPU_matrix_rotate_3f(RAD2DEGF(rc->initial_value), 0.0f, 0.0f, 1.0f); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE, 0.0f); | immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE, 0.0f); | ||||
| ▲ Show 20 Lines • Show All 1,666 Lines • Show Last 20 Lines | |||||