Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_knife.c
| Show First 20 Lines • Show All 483 Lines • ▼ Show 20 Lines | |||||
| static void knifetool_draw_visible_distances(const KnifeTool_OpData *kcd) | static void knifetool_draw_visible_distances(const KnifeTool_OpData *kcd) | ||||
| { | { | ||||
| GPU_matrix_push_projection(); | GPU_matrix_push_projection(); | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| GPU_matrix_identity_set(); | GPU_matrix_identity_set(); | ||||
| wmOrtho2_region_pixelspace(kcd->region); | wmOrtho2_region_pixelspace(kcd->region); | ||||
| 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); | ||||
| char numstr[256]; | char numstr[256]; | ||||
| float numstr_size[2]; | float numstr_size[2]; | ||||
| float posit[2]; | float posit[2]; | ||||
| const float bg_margin = 4.0f * U.dpi_fac; | const float bg_margin = 4.0f * U.dpi_fac; | ||||
| const float font_size = 14.0f * U.pixelsize; | const float font_size = 14.0f * U.pixelsize; | ||||
| const int distance_precision = 4; | const int distance_precision = 4; | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | static void knifetool_draw_angle(const KnifeTool_OpData *kcd, | ||||
| /* Angle text and background in 2d space. */ | /* Angle text and background in 2d space. */ | ||||
| GPU_matrix_push_projection(); | GPU_matrix_push_projection(); | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| GPU_matrix_identity_set(); | GPU_matrix_identity_set(); | ||||
| wmOrtho2_region_pixelspace(kcd->region); | wmOrtho2_region_pixelspace(kcd->region); | ||||
| uint pos_2d = GPU_vertformat_attr_add( | uint pos_2d = 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); | ||||
| /* Angle as string. */ | /* Angle as string. */ | ||||
| char numstr[256]; | char numstr[256]; | ||||
| float numstr_size[2]; | float numstr_size[2]; | ||||
| float posit[2]; | float posit[2]; | ||||
| UnitSettings *unit = &kcd->scene->unit; | UnitSettings *unit = &kcd->scene->unit; | ||||
| if (unit->system == USER_UNIT_NONE) { | if (unit->system == USER_UNIT_NONE) { | ||||
| ▲ Show 20 Lines • Show All 4,477 Lines • Show Last 20 Lines | |||||