Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_icons.c
| Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | static void vicon_colorset_draw(int index, int x, int y, int w, int h, float UNUSED(alpha)) | ||||
| * x-----a-----b-----c | * x-----a-----b-----c | ||||
| */ | */ | ||||
| const int a = x + w / 3; | const int a = x + w / 3; | ||||
| const int b = x + w / 3 * 2; | const int b = x + w / 3 * 2; | ||||
| const int c = x + w; | const int c = x + w; | ||||
| 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); | ||||
| /* XXX: Include alpha into this... */ | /* XXX: Include alpha into this... */ | ||||
| /* normal */ | /* normal */ | ||||
| immUniformColor3ubv(cs->solid); | immUniformColor3ubv(cs->solid); | ||||
| immRecti(pos, x, y, a, y + h); | immRecti(pos, x, y, a, y + h); | ||||
| /* selected */ | /* selected */ | ||||
| immUniformColor3ubv(cs->select); | immUniformColor3ubv(cs->select); | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | static void vicon_gplayer_color_draw(Icon *icon, int x, int y, int w, int h) | ||||
| bGPDlayer *gpl = (bGPDlayer *)icon->obj; | bGPDlayer *gpl = (bGPDlayer *)icon->obj; | ||||
| /* Just draw a colored rect - Like for vicon_colorset_draw() */ | /* Just draw a colored rect - Like for vicon_colorset_draw() */ | ||||
| /* TODO: Make this have rounded corners, and maybe be a bit smaller. | /* TODO: Make this have rounded corners, and maybe be a bit smaller. | ||||
| * However, UI_draw_roundbox_aa() draws the colors too dark, so can't be used. | * However, UI_draw_roundbox_aa() draws the colors too dark, so can't be used. | ||||
| */ | */ | ||||
| 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); | ||||
| immUniformColor3fv(gpl->color); | immUniformColor3fv(gpl->color); | ||||
| immRecti(pos, x, y, x + w - 1, y + h - 1); | immRecti(pos, x, y, x + w - 1, y + h - 1); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| static void init_brush_icons(void) | static void init_brush_icons(void) | ||||
| ▲ Show 20 Lines • Show All 1,968 Lines • Show Last 20 Lines | |||||