Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_draw.c
| Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | |||||
| static void wm_software_cursor_draw_crosshair(const int event_xy[2]) | static void wm_software_cursor_draw_crosshair(const int event_xy[2]) | ||||
| { | { | ||||
| /* Draw a primitive cross-hair cursor. | /* Draw a primitive cross-hair cursor. | ||||
| * NOTE: the `win->cursor` could be used for drawing although it's complicated as some cursors | * NOTE: the `win->cursor` could be used for drawing although it's complicated as some cursors | ||||
| * are set by the operating-system, where the pixel information isn't easily available. */ | * are set by the operating-system, where the pixel information isn't easily available. */ | ||||
| const float unit = max_ff(U.dpi_fac, 1.0f); | const float unit = max_ff(U.dpi_fac, 1.0f); | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor4f(1, 1, 1, 1); | immUniformColor4f(1, 1, 1, 1); | ||||
| { | { | ||||
| const int ofs_line = (8 * unit); | const int ofs_line = (8 * unit); | ||||
| const int ofs_size = (2 * unit); | const int ofs_size = (2 * unit); | ||||
| immRecti(pos, | immRecti(pos, | ||||
| event_xy[0] - ofs_line, | event_xy[0] - ofs_line, | ||||
| event_xy[1] - ofs_size, | event_xy[1] - ofs_size, | ||||
| ▲ Show 20 Lines • Show All 1,180 Lines • Show Last 20 Lines | |||||