Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Context not available. | |||||
| BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size); | BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size); | ||||
| glColor4ub(255, 0, 0, alpha_debug); | VertexFormat* format = immVertexFormat(); | ||||
| fdrawbox(click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax); | unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | ||||
| glColor4ub(0, 255, 255, alpha_debug); | |||||
| fdrawline(click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax); | immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); | ||||
merwin: The immUniformColor calls only work with UNIFORM_COLOR shaders. Use different shader here. | |||||
| fdrawline(click_rect.xmin, click_rect.ymax, click_rect.xmax, click_rect.ymin); | |||||
| immUniformColor4ub(255, 0, 0, alpha_debug); | |||||
| imm_draw_line_box(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax); | |||||
| immUniformColor4ub(0, 255, 255, alpha_debug); | |||||
| imm_draw_line_box(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax); | |||||
Done Inline ActionsI'm not sure I understand why you replace fdrawline with imm_draw_line_box? krash: I'm not sure I understand why you replace fdrawline with imm_draw_line_box? | |||||
Done Inline ActionsGood catch @Anthony Edlin (krash). There is no replacement function for fdrawline, so expand these into Begin(LINES, 4) Vertex Vertex Vertex Vertex End merwin: Good catch @krash.
There is no replacement function for fdrawline, so expand these into
```… | |||||
| imm_draw_line_box(pos, click_rect.xmin, click_rect.ymax, click_rect.xmax, click_rect.ymin); | |||||
| immUnbindProgram(); | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| float width = 0.1f * U.widget_unit; | float width = 0.1f * U.widget_unit; | ||||
| float pad = 0.2f * U.widget_unit; | float pad = 0.2f * U.widget_unit; | ||||
| glRectf((x1 + x2 - width) * 0.5f, y1 + pad, (x1 + x2 + width) * 0.5f, y2 - pad); | VertexFormat* format = immVertexFormat(); | ||||
| glRectf(x1 + pad, (y1 + y2 - width) * 0.5f, (x1 + x2 - width) * 0.5f, (y1 + y2 + width) * 0.5f); | unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | ||||
| glRectf((x1 + x2 + width) * 0.5f, (y1 + y2 - width) * 0.5f, x2 - pad, (y1 + y2 + width) * 0.5f); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| immRectf(pos, (x1 + x2 - width) * 0.5f, y1 + pad, (x1 + x2 + width) * 0.5f, y2 - pad); | |||||
| immRectf(pos, x1 + pad, (y1 + y2 - width) * 0.5f, (x1 + x2 - width) * 0.5f, (y1 + y2 + width) * 0.5f); | |||||
| immRectf(pos, (x1 + x2 + width) * 0.5f, (y1 + y2 - width) * 0.5f, x2 - pad, (y1 + y2 + width) * 0.5f); | |||||
| immUnbindProgram(); | |||||
| } | } | ||||
| static void region_draw_azone_tab_plus(AZone *az) | static void region_draw_azone_tab_plus(AZone *az) | ||||
| Context not available. | |||||
| /* for debugging unneeded area redraws and partial redraw */ | /* for debugging unneeded area redraws and partial redraw */ | ||||
| #if 0 | #if 0 | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glColor4f(drand48(), drand48(), drand48(), 0.1f); | VertexFormat* format = immVertexFormat(); | ||||
| glRectf(ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, | unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); | |||||
merwinUnsubmitted Done Inline ActionsUse UNIFORM_COLOR shader here. merwin: Use UNIFORM_COLOR shader here. | |||||
| immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); | |||||
| immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, | |||||
| ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin); | ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin); | ||||
| immUnbindProgram(); | |||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| #endif | #endif | ||||
| Context not available. | |||||
| /* view should be in pixelspace */ | /* view should be in pixelspace */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| UI_ThemeColor4((ar->type->regionid == RGN_TYPE_PREVIEW) ? TH_PREVIEW_BACK : TH_BACK); | VertexFormat* format = immVertexFormat(); | ||||
| glRecti(0, 0, BLI_rcti_size_x(&ar->winrct), BLI_rcti_size_y(&ar->winrct) + 1); | unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| immUniformThemeColor((ar->type->regionid == RGN_TYPE_PREVIEW) ? TH_PREVIEW_BACK : TH_BACK); | |||||
| immRecti(pos, 0, 0, BLI_rcti_size_x(&ar->winrct), BLI_rcti_size_y(&ar->winrct) + 1); | |||||
| immUnbindProgram(); | |||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
The immUniformColor calls only work with UNIFORM_COLOR shaders. Use different shader here.