Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_draw.c
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4]) | ||||
| immUniformColor4fv(color); | immUniformColor4fv(color); | ||||
| immRecti(pos, pos_x, pos_y - ofs_y, pos_x + len, pos_y - ofs_y + (height * U.pixelsize)); | immRecti(pos, pos_x, pos_y - ofs_y, pos_x + len, pos_y - ofs_y + (height * U.pixelsize)); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| /* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */ | /* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */ | ||||
| /* based on UI_draw_roundbox_gl_mode, | |||||
| * check on making a version which allows us to skip some sides */ | |||||
| void ui_draw_but_TAB_outline(const rcti *rect, | void ui_draw_but_TAB_outline(const rcti *rect, | ||||
| float rad, | float rad, | ||||
| uchar highlight[3], | uchar highlight[3], | ||||
| uchar highlight_fade[3]) | uchar highlight_fade[3]) | ||||
| { | { | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| const uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | const uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| const uint col = GPU_vertformat_attr_add( | const uint col = GPU_vertformat_attr_add( | ||||
| ▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
| # if 0 | # if 0 | ||||
| /* Restore scissor-test. */ | /* Restore scissor-test. */ | ||||
| GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]); | GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]); | ||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| } | } | ||||
| /** | |||||
| * Draw title and text safe areas. | |||||
| * | |||||
| * \note This function is to be used with the 2D dashed shader enabled. | |||||
| * | |||||
| * \param pos: is a #PRIM_FLOAT, 2, #GPU_FETCH_FLOAT vertex attribute. | |||||
| * \param x1, x2, y1, y2: The offsets for the view, not the zones. | |||||
| */ | |||||
| void UI_draw_safe_areas(uint pos, | void UI_draw_safe_areas(uint pos, | ||||
| const rctf *rect, | const rctf *rect, | ||||
| const float title_aspect[2], | const float title_aspect[2], | ||||
| const float action_aspect[2]) | const float action_aspect[2]) | ||||
| { | { | ||||
| const float size_x_half = (rect->xmax - rect->xmin) * 0.5f; | const float size_x_half = (rect->xmax - rect->xmin) * 0.5f; | ||||
| const float size_y_half = (rect->ymax - rect->ymin) * 0.5f; | const float size_y_half = (rect->ymax - rect->ymin) * 0.5f; | ||||
| ▲ Show 20 Lines • Show All 1,381 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| static bool point_draw_handles(CurveProfilePoint *point) | static bool point_draw_handles(CurveProfilePoint *point) | ||||
| { | { | ||||
| return (point->flag & PROF_SELECT && | return (point->flag & PROF_SELECT && | ||||
| (ELEM(point->h1, HD_FREE, HD_ALIGN) || ELEM(point->h2, HD_FREE, HD_ALIGN))) || | (ELEM(point->h1, HD_FREE, HD_ALIGN) || ELEM(point->h2, HD_FREE, HD_ALIGN))) || | ||||
| ELEM(point->flag, PROF_H1_SELECT, PROF_H2_SELECT); | ELEM(point->flag, PROF_H1_SELECT, PROF_H2_SELECT); | ||||
| } | } | ||||
| /** | |||||
| * Draws the curve profile widget. Somewhat similar to ui_draw_but_CURVE. | |||||
| */ | |||||
| void ui_draw_but_CURVEPROFILE(ARegion *region, | void ui_draw_but_CURVEPROFILE(ARegion *region, | ||||
| uiBut *but, | uiBut *but, | ||||
| const uiWidgetColors *wcol, | const uiWidgetColors *wcol, | ||||
| const rcti *rect) | const rcti *rect) | ||||
| { | { | ||||
| float fx, fy; | float fx, fy; | ||||
| uiButCurveProfile *but_profile = (uiButCurveProfile *)but; | uiButCurveProfile *but_profile = (uiButCurveProfile *)but; | ||||
| ▲ Show 20 Lines • Show All 627 Lines • Show Last 20 Lines | |||||