Cleanup: naming

- immAttrib*    -> immAttr*
- immSkipAttrib -> immAttrSkip

Term 'attr' is a convention for GPU module.
This commit is contained in:
Campbell Barton 2018-10-09 11:01:50 +11:00
parent 9b49a0d971
commit e7218e7049
27 changed files with 241 additions and 241 deletions

View File

@ -161,10 +161,10 @@ static void drw_debug_draw_lines(void)
while (DST.debug.lines) {
void *next = DST.debug.lines->next;
immAttrib4fv(col, DST.debug.lines->color);
immAttr4fv(col, DST.debug.lines->color);
immVertex3fv(pos, DST.debug.lines->pos[0]);
immAttrib4fv(col, DST.debug.lines->color);
immAttr4fv(col, DST.debug.lines->color);
immVertex3fv(pos, DST.debug.lines->pos[1]);
MEM_freeN(DST.debug.lines);

View File

@ -270,13 +270,13 @@ void DRW_transform_to_display(GPUTexture *tex, bool use_view_settings)
/* Full screen triangle */
immBegin(GPU_PRIM_TRIS, 3);
immAttrib2f(texco, 0.0f, 0.0f);
immAttr2f(texco, 0.0f, 0.0f);
immVertex2f(pos, -1.0f, -1.0f);
immAttrib2f(texco, 2.0f, 0.0f);
immAttr2f(texco, 2.0f, 0.0f);
immVertex2f(pos, 3.0f, -1.0f);
immAttrib2f(texco, 0.0f, 2.0f);
immAttr2f(texco, 0.0f, 2.0f);
immVertex2f(pos, -1.0f, 3.0f);
immEnd();
@ -2201,16 +2201,16 @@ static void draw_depth_texture_to_screen(GPUTexture *texture)
immBegin(GPU_PRIM_TRI_STRIP, 4);
immAttrib2f(texcoord, 0.0f, 0.0f);
immAttr2f(texcoord, 0.0f, 0.0f);
immVertex2f(pos, 0.0f, 0.0f);
immAttrib2f(texcoord, 1.0f, 0.0f);
immAttr2f(texcoord, 1.0f, 0.0f);
immVertex2f(pos, w, 0.0f);
immAttrib2f(texcoord, 0.0f, 1.0f);
immAttr2f(texcoord, 0.0f, 1.0f);
immVertex2f(pos, 0.0f, h);
immAttrib2f(texcoord, 1.0f, 1.0f);
immAttr2f(texcoord, 1.0f, 1.0f);
immVertex2f(pos, w, h);
immEnd();

View File

@ -108,11 +108,11 @@ void DRW_draw_background(void)
UI_GetThemeColor3ubv(TH_HIGH_GRAD, col_hi);
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib3ubv(color, col_lo);
immAttr3ubv(color, col_lo);
immVertex2f(pos, -1.0f, -1.0f);
immVertex2f(pos, 1.0f, -1.0f);
immAttrib3ubv(color, col_hi);
immAttr3ubv(color, col_hi);
immVertex2f(pos, 1.0f, 1.0f);
immVertex2f(pos, -1.0f, 1.0f);
immEnd();

View File

@ -552,9 +552,9 @@ void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type,
}
}
immAttrib1f(size_id, size);
immAttrib4ubv(color_id, fill_col);
immAttrib4ubv(outline_color_id, outline_col);
immAttr1f(size_id, size);
immAttr4ubv(color_id, fill_col);
immAttr4ubv(outline_color_id, outline_col);
immVertex2f(pos_id, x, y);
}

View File

@ -413,7 +413,7 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
BLI_assert(ELEM(prim_type, GPU_PRIM_TRI_FAN));
immBegin(prim_type, verts_len);
immAttrib3f(attr_id.col, 0.0f, 0.0f, 0.0f);
immAttr3f(attr_id.col, 0.0f, 0.0f, 0.0f);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}
@ -424,7 +424,7 @@ static void cage2d_draw_box_interaction(
GPU_line_width(line_width + 3.0f);
immBegin(prim_type, verts_len);
immAttrib3f(attr_id.col, 0.0f, 0.0f, 0.0f);
immAttr3f(attr_id.col, 0.0f, 0.0f, 0.0f);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}
@ -433,7 +433,7 @@ static void cage2d_draw_box_interaction(
GPU_line_width(line_width);
immBegin(prim_type, verts_len);
immAttrib3fv(attr_id.col, color);
immAttr3fv(attr_id.col, color);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}

View File

@ -664,21 +664,21 @@ static void gp_draw_strokes_edit(
/* size and color first */
if (show_direction_hint && i == 0) {
/* start point in green bigger */
immAttrib3f(color, 0.0f, 1.0f, 0.0f);
immAttrib1f(size, vsize + 4);
immAttr3f(color, 0.0f, 1.0f, 0.0f);
immAttr1f(size, vsize + 4);
}
else if (show_direction_hint && (i == gps->totpoints - 1)) {
/* end point in red smaller */
immAttrib3f(color, 1.0f, 0.0f, 0.0f);
immAttrib1f(size, vsize + 1);
immAttr3f(color, 1.0f, 0.0f, 0.0f);
immAttr1f(size, vsize + 1);
}
else if (pt->flag & GP_SPOINT_SELECT) {
immAttrib3fv(color, selectColor);
immAttrib1f(size, vsize);
immAttr3fv(color, selectColor);
immAttr1f(size, vsize);
}
else {
immAttrib3fv(color, gpl->color);
immAttrib1f(size, bsize);
immAttr3fv(color, gpl->color);
immAttr1f(size, bsize);
}
/* then position */

View File

@ -118,7 +118,7 @@ static void gp_set_tpoint_varying_color(const tGPspoint *pt, const float ink[4],
{
float alpha = ink[3] * pt->strength;
CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
immAttrib4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
immAttr4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
}
static void gp_set_point_uniform_color(const bGPDspoint *pt, const float ink[4])
@ -132,7 +132,7 @@ static void gp_set_point_varying_color(const bGPDspoint *pt, const float ink[4],
{
float alpha = ink[3] * pt->strength;
CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
immAttrib4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
immAttr4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
}
/* draw fills for buffer stroke */
@ -340,7 +340,7 @@ static void gp_draw_stroke_volumetric_buffer(const tGPspoint *points, int totpoi
const tGPspoint *pt = points;
for (int i = 0; i < totpoints; i++, pt++) {
gp_set_tpoint_varying_color(pt, ink, color);
immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */
immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */
immVertex2f(pos, pt->x, pt->y);
}
@ -374,7 +374,7 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points, int totpoints
gp_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, co);
gp_set_point_varying_color(pt, ink, color);
immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immVertex2f(pos, co[0], co[1]);
}
@ -400,7 +400,7 @@ static void gp_draw_stroke_volumetric_3d(
const bGPDspoint *pt = points;
for (int i = 0; i < totpoints && pt; i++, pt++) {
gp_set_point_varying_color(pt, ink, color);
immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immVertex3fv(pos, &pt->x); /* we can adjust size in vertex shader based on view/projection! */
}
@ -580,7 +580,7 @@ static void gp_add_filldata_tobuffer(
fpt[2] = 0.0f; /* 2d always is z=0.0f */
}
immAttrib2f(texcoord, uv[0], uv[1]); /* texture coordinates */
immAttr2f(texcoord, uv[0], uv[1]); /* texture coordinates */
immVertex3fv(pos, fpt); /* position */
}
@ -764,7 +764,7 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
/* first point for adjacency (not drawn) */
if (i == 0) {
gp_set_point_varying_color(points, ink, attr_id.color);
immAttrib1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
immAttr1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
if ((cyclic) && (totpoints > 2)) {
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 1)->x);
}
@ -776,7 +776,7 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
}
/* set point */
gp_set_point_varying_color(pt, ink, attr_id.color);
immAttrib1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
immAttr1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &pt->x);
immVertex3fv(attr_id.pos, fpt);
@ -785,19 +785,19 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
if (cyclic && totpoints > 2) {
/* draw line to first point to complete the cycle */
immAttrib1f(attr_id.thickness, max_ff(points->pressure * thickness, 1.0f));
immAttr1f(attr_id.thickness, max_ff(points->pressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &points->x);
immVertex3fv(attr_id.pos, fpt);
/* now add adjacency point (not drawn) */
immAttrib1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f));
immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + 1)->x);
immVertex3fv(attr_id.pos, fpt);
}
/* last adjacency point (not drawn) */
else {
gp_set_point_varying_color(points + totpoints - 1, ink, attr_id.color);
immAttrib1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
immAttr1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 2)->x);
mul_v3_fl(fpt, -1.0f);
immVertex3fv(attr_id.pos, fpt);
@ -1321,21 +1321,21 @@ static void gp_draw_strokes_edit(
/* size and color first */
if (show_direction_hint && i == 0) {
/* start point in green bigger */
immAttrib3f(color, 0.0f, 1.0f, 0.0f);
immAttrib1f(size, vsize + 4);
immAttr3f(color, 0.0f, 1.0f, 0.0f);
immAttr1f(size, vsize + 4);
}
else if (show_direction_hint && (i == gps->totpoints - 1)) {
/* end point in red smaller */
immAttrib3f(color, 1.0f, 0.0f, 0.0f);
immAttrib1f(size, vsize + 1);
immAttr3f(color, 1.0f, 0.0f, 0.0f);
immAttr1f(size, vsize + 1);
}
else if (pt->flag & GP_SPOINT_SELECT) {
immAttrib3fv(color, selectColor);
immAttrib1f(size, vsize);
immAttr3fv(color, selectColor);
immAttr1f(size, vsize);
}
else {
immAttrib3fv(color, gp_style->stroke_rgba);
immAttrib1f(size, bsize);
immAttr3fv(color, gp_style->stroke_rgba);
immAttr1f(size, bsize);
}
/* then position */

View File

@ -166,14 +166,14 @@ static void gp_draw_basic_stroke(
col[3] = 1.0f;
}
/* set point */
immAttrib4fv(color, col);
immAttr4fv(color, col);
mul_v3_m4v3(fpt, diff_mat, &pt->x);
immVertex3fv(pos, fpt);
}
if (cyclic && totpoints > 2) {
/* draw line to first point to complete the cycle */
immAttrib4fv(color, col);
immAttr4fv(color, col);
mul_v3_m4v3(fpt, diff_mat, &points->x);
immVertex3fv(pos, fpt);
}

View File

@ -259,7 +259,7 @@ static void round_box_shade_col(unsigned attrib, const float col1[3], float cons
fac * col1[2] + (1.0f - fac) * col2[2],
1.0f
};
immAttrib4fv(attrib, col);
immAttr4fv(attrib, col);
}
#endif
@ -573,7 +573,7 @@ void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highligh
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
immBeginAtMost(GPU_PRIM_LINE_STRIP, 25);
immAttrib3ubv(col, highlight);
immAttr3ubv(col, highlight);
/* start with corner left-top */
if (roundboxtype & UI_CNR_TOP_LEFT) {
@ -599,7 +599,7 @@ void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highligh
immVertex2f(pos, maxx, maxy);
}
immAttrib3ubv(col, highlight_fade);
immAttr3ubv(col, highlight_fade);
/* corner right-bottom */
if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
@ -625,7 +625,7 @@ void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highligh
immVertex2f(pos, minx, miny);
}
immAttrib3ubv(col, highlight);
immAttr3ubv(col, highlight);
/* back to corner left-top */
immVertex2f(pos, minx, roundboxtype & UI_CNR_TOP_LEFT ? maxy - rad : maxy);
@ -1456,7 +1456,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti
v1[0] = v2[0] = x1 + a;
immAttrib4fv(col_id, colf);
immAttr4fv(col_id, colf);
immVertex2fv(pos_id, v1);
immVertex2fv(pos_id, v2);
}
@ -1475,7 +1475,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti
v1[0] = v2[0] = x1 + a;
immAttrib4f(col_id, colf[0], colf[1], colf[2], 1.0f);
immAttr4f(col_id, colf[0], colf[1], colf[2], 1.0f);
immVertex2fv(pos_id, v1);
immVertex2fv(pos_id, v2);
}
@ -1822,7 +1822,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
UI_GetThemeColor4fv(TH_TEXT, color);
float fx = rect->xmin + zoomx * (cmp[a].x - offsx);
float fy = rect->ymin + zoomy * (cmp[a].y - offsy);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, fx, fy);
}
immEnd();
@ -1945,9 +1945,9 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *U
float y2 = pos_sel[i + 1] * axe;
if (i % 2 == 1)
immAttrib4fv(col, col_sel);
immAttr4fv(col, col_sel);
else
immAttrib4fv(col, col_outline);
immAttr4fv(col, col_outline);
immVertex2f(pos, x1, y1);
immVertex2f(pos, x2, y2);
@ -2078,38 +2078,38 @@ static void ui_shadowbox(unsigned pos, unsigned color, float minx, float miny, f
const float v8[2] = {minx + 0.5f * shadsize, miny - shadsize};
/* right quad */
immAttrib4ub(color, 0, 0, 0, alpha);
immAttr4ub(color, 0, 0, 0, alpha);
immVertex2fv(pos, v3);
immVertex2fv(pos, v1);
immAttrib4ub(color, 0, 0, 0, 0);
immAttr4ub(color, 0, 0, 0, 0);
immVertex2fv(pos, v2);
immVertex2fv(pos, v2);
immVertex2fv(pos, v4);
immAttrib4ub(color, 0, 0, 0, alpha);
immAttr4ub(color, 0, 0, 0, alpha);
immVertex2fv(pos, v3);
/* corner shape */
/* immAttrib4ub(color, 0, 0, 0, alpha); */ /* Not needed, done above in previous tri */
/* immAttr4ub(color, 0, 0, 0, alpha); */ /* Not needed, done above in previous tri */
immVertex2fv(pos, v3);
immAttrib4ub(color, 0, 0, 0, 0);
immAttr4ub(color, 0, 0, 0, 0);
immVertex2fv(pos, v4);
immVertex2fv(pos, v5);
immVertex2fv(pos, v5);
immVertex2fv(pos, v6);
immAttrib4ub(color, 0, 0, 0, alpha);
immAttr4ub(color, 0, 0, 0, alpha);
immVertex2fv(pos, v3);
/* bottom quad */
/* immAttrib4ub(color, 0, 0, 0, alpha); */ /* Not needed, done above in previous tri */
/* immAttr4ub(color, 0, 0, 0, alpha); */ /* Not needed, done above in previous tri */
immVertex2fv(pos, v3);
immAttrib4ub(color, 0, 0, 0, 0);
immAttr4ub(color, 0, 0, 0, 0);
immVertex2fv(pos, v6);
immVertex2fv(pos, v8);
immVertex2fv(pos, v8);
immAttrib4ub(color, 0, 0, 0, alpha);
immAttr4ub(color, 0, 0, 0, alpha);
immVertex2fv(pos, v7);
immVertex2fv(pos, v3);
}

View File

@ -551,18 +551,18 @@ static void immRectf_tris_color_ex(
unsigned int pos, float x1, float y1, float x2, float y2,
unsigned int col, const float color[3])
{
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y2);
}
@ -1823,7 +1823,7 @@ static void ui_panel_category_draw_tab(
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
immBegin(filled ? GPU_PRIM_TRI_FAN : GPU_PRIM_LINE_STRIP, vert_len);
for (int i = 0; i < buf_index; i++) {
immAttrib3ubv(color, cbuf[i]);
immAttr3ubv(color, cbuf[i]);
immVertex2fv(pos, vbuf[i]);
}
immEnd();

View File

@ -940,7 +940,7 @@ static void widget_draw_vertex_buffer(unsigned int pos, unsigned int col, int mo
immBegin(mode, totvert);
for (int i = 0; i < totvert; ++i) {
if (quads_col)
immAttrib4ubv(col, quads_col[i]);
immAttr4ubv(col, quads_col[i]);
immVertex2fv(pos, quads_pos[i]);
}
immEnd();
@ -2592,7 +2592,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
immBegin(GPU_PRIM_TRI_FAN, tot + 2);
immAttrib3fv(color, colcent);
immAttr3fv(color, colcent);
immVertex2f(pos, centx, centy);
float ang = 0.0f;
@ -2604,7 +2604,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *
ui_color_picker_to_rgb_v(hsv, col);
immAttrib3fv(color, col);
immAttr3fv(color, col);
immVertex2f(pos, centx + co * radius, centy + si * radius);
}
immEnd();
@ -2760,22 +2760,22 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons
dy = (float)BLI_rcti_size_y(rect) / 3.0f;
for (a = 0; a < 3; a++, sy += dy) {
immAttrib4f(col, col0[a][0], col0[a][1], col0[a][2], alpha);
immAttr4f(col, col0[a][0], col0[a][1], col0[a][2], alpha);
immVertex2f(pos, sx1, sy);
immAttrib4f(col, col1[a][0], col1[a][1], col1[a][2], alpha);
immAttr4f(col, col1[a][0], col1[a][1], col1[a][2], alpha);
immVertex2f(pos, sx2, sy);
immAttrib4f(col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
immAttr4f(col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
immVertex2f(pos, sx2, sy + dy);
immAttrib4f(col, col0[a][0], col0[a][1], col0[a][2], alpha);
immAttr4f(col, col0[a][0], col0[a][1], col0[a][2], alpha);
immVertex2f(pos, sx1, sy);
immAttrib4f(col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
immAttr4f(col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
immVertex2f(pos, sx2, sy + dy);
immAttrib4f(col, col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
immAttr4f(col, col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
immVertex2f(pos, sx1, sy + dy);
}
}
@ -4515,14 +4515,14 @@ static void draw_disk_shaded(
if (shaded) {
fac = (y1 + radius_ext) * radius_ext_scale;
round_box_shade_col4_r(r_col, col1, col2, fac);
immAttrib4ubv(col, r_col);
immAttr4ubv(col, r_col);
}
immVertex2f(pos, c * radius_int, s * radius_int);
if (shaded) {
fac = (y2 + radius_ext) * radius_ext_scale;
round_box_shade_col4_r(r_col, col1, col2, fac);
immAttrib4ubv(col, r_col);
immAttr4ubv(col, r_col);
}
immVertex2f(pos, c * radius_ext, s * radius_ext);
}

View File

@ -1358,9 +1358,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
UI_GetThemeColor3ubv(TH_GRID, grid_line_color);
for (a = 0; a < step; a++) {
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
vec2[0] = vec1[0] += grid->dx;
@ -1374,9 +1374,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
step++;
for (a = 0; a <= step; a++) {
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
vec2[0] = vec1[0] -= grid->dx;
@ -1395,9 +1395,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
UI_GetThemeColor3ubv(TH_GRID, grid_line_color);
for (a = 0; a <= step; a++) {
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
vec2[1] = vec1[1] += grid->dy;
@ -1410,9 +1410,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
if (flag & V2D_HORIZONTAL_FINELINES) {
UI_GetThemeColorShade3ubv(TH_GRID, 16, grid_line_color);
for (a = 0; a < step; a++) {
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
vec2[1] = vec1[1] -= grid->dy;
@ -1429,9 +1429,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
vec2[0] = v2d->cur.xmax;
vec1[1] = vec2[1] = 0.0f;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
}
@ -1441,9 +1441,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
vec2[1] = v2d->cur.ymax;
vec1[0] = vec2[0] = 0.0f;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2fv(pos, vec1);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2fv(pos, vec2);
}
@ -1490,7 +1490,7 @@ void UI_view2d_constant_grid_draw(View2D *v2d, float step)
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
immBegin(GPU_PRIM_LINES, count_x * 2 + count_y * 2 + 4);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
for (int i = 0; i < count_x ; start_x += step, i++) {
immVertex2f(pos, start_x, v2d->cur.ymin);
immVertex2f(pos, start_x, v2d->cur.ymax);
@ -1504,7 +1504,7 @@ void UI_view2d_constant_grid_draw(View2D *v2d, float step)
/* X and Y axis */
UI_GetThemeColorShade3fv(TH_BACK, -18, theme_color);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, 0.0f, v2d->cur.ymin);
immVertex2f(pos, 0.0f, v2d->cur.ymax);
immVertex2f(pos, v2d->cur.xmin, 0.0f);
@ -1552,9 +1552,9 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
if (i == 0 || (level < totlevels - 1 && i % level_size == 0))
continue;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2f(pos, start, v2d->cur.ymin);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2f(pos, start, v2d->cur.ymax);
}
@ -1567,9 +1567,9 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
if (i == 0 || (level < totlevels - 1 && i % level_size == 0))
continue;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2f(pos, v2d->cur.xmin, start);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2f(pos, v2d->cur.xmax, start);
}
@ -1580,14 +1580,14 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
/* X and Y axis */
UI_GetThemeColorShade3ubv(colorid, -18 + ((totlevels - 1) * -6), grid_line_color);
immSkipAttrib(color);
immAttrSkip(color);
immVertex2f(pos, 0.0f, v2d->cur.ymin);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2f(pos, 0.0f, v2d->cur.ymax);
immSkipAttrib(color);
immAttrSkip(color);
immVertex2f(pos, v2d->cur.xmin, 0.0f);
immAttrib3ubv(color, grid_line_color);
immAttr3ubv(color, grid_line_color);
immVertex2f(pos, v2d->cur.xmax, 0.0f);
immEnd();

View File

@ -2865,13 +2865,13 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
/* the fine resolution level */
for (int i = 0; i < count_fine; i++) {
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1, y1 * (1.0f - fac) + y2 * fac);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x2, y1 * (1.0f - fac) + y2 * fac);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1 * (1.0f - fac) + x2 * fac, y1);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1 * (1.0f - fac) + x2 * fac, y2);
fac += gridstep;
}
@ -2882,13 +2882,13 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
/* the large resolution level */
for (int i = 0; i < count_large; i++) {
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1, y1 * (1.0f - fac) + y2 * fac);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x2, y1 * (1.0f - fac) + y2 * fac);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1 * (1.0f - fac) + x2 * fac, y1);
immAttrib3fv(color, theme_color);
immAttr3fv(color, theme_color);
immVertex2f(pos, x1 * (1.0f - fac) + x2 * fac, y2);
fac += 4.0f * gridstep;
}

View File

@ -297,16 +297,16 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state,
}
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texco, (float)(0 + offset_left) / tex_w, (float)(0 + offset_bot) / tex_h);
immAttr2f(texco, (float)(0 + offset_left) / tex_w, (float)(0 + offset_bot) / tex_h);
immVertex2f(pos, rast_x + (float)offset_left * xzoom, rast_y + (float)offset_bot * yzoom);
immAttrib2f(texco, (float)(subpart_w - offset_right) / tex_w, (float)(0 + offset_bot) / tex_h);
immAttr2f(texco, (float)(subpart_w - offset_right) / tex_w, (float)(0 + offset_bot) / tex_h);
immVertex2f(pos, rast_x + (float)(subpart_w - offset_right) * xzoom * scaleX, rast_y + (float)offset_bot * yzoom);
immAttrib2f(texco, (float)(subpart_w - offset_right) / tex_w, (float)(subpart_h - offset_top) / tex_h);
immAttr2f(texco, (float)(subpart_w - offset_right) / tex_w, (float)(subpart_h - offset_top) / tex_h);
immVertex2f(pos, rast_x + (float)(subpart_w - offset_right) * xzoom * scaleX, rast_y + (float)(subpart_h - offset_top) * yzoom * scaleY);
immAttrib2f(texco, (float)(0 + offset_left) / tex_w, (float)(subpart_h - offset_top) / tex_h);
immAttr2f(texco, (float)(0 + offset_left) / tex_w, (float)(subpart_h - offset_top) / tex_h);
immVertex2f(pos, rast_x + (float)offset_left * xzoom, rast_y + (float)(subpart_h - offset_top) * yzoom * scaleY);
immEnd();
}

View File

@ -694,13 +694,13 @@ static void paint_draw_tex_overlay(
immUniform1i("image", GL_TEXTURE0);
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, quad.xmax, quad.ymin);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, quad.xmax, quad.ymax);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, quad.xmin, quad.ymax);
immEnd();
@ -777,13 +777,13 @@ static void paint_draw_cursor_overlay(
immUniform1i("image", 0);
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, quad.xmax, quad.ymin);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, quad.xmax, quad.ymax);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, quad.xmin, quad.ymax);
immEnd();

View File

@ -82,7 +82,7 @@ static void draw_keyframe_shape(float x, float y, bool sel, float alpha,
UI_GetThemeColorShadeAlpha4fv(TH_STRIP_SELECT, 50, -255 * (1.0f - alpha), color);
}
immAttrib4fv(color_id, color);
immAttr4fv(color_id, color);
immVertex2f(pos_id, x, y);
}
@ -225,8 +225,8 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
immBegin(GPU_PRIM_POINTS, keyframe_len);
/* all same size with black outline */
immAttrib1f(size_id, 2.0f * STRIP_HEIGHT_HALF);
immAttrib4ub(outline_color_id, 0, 0, 0, 255);
immAttr1f(size_id, 2.0f * STRIP_HEIGHT_HALF);
immAttr4ub(outline_color_id, 0, 0, 0, 255);
y = (float) CHANNEL_FIRST; /* start again at the top */
for (channel = dopesheet->channels.first; channel; channel = channel->next) {

View File

@ -1154,16 +1154,16 @@ static void draw_plane_marker_image(Scene *scene,
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, 0.0f, 0.0f);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, 1.0f, 0.0f);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, 1.0f, 1.0f);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, 0.0f, 1.0f);
immEnd();

View File

@ -515,15 +515,15 @@ static void draw_dividers(FileLayout *layout, View2D *v2d)
sx += step;
v1[0] = v2[0] = sx;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2iv(pos, v1);
immAttrib3ubv(color, col_lo);
immAttr3ubv(color, col_lo);
immVertex2iv(pos, v2);
v1[0] = v2[0] = sx + 1;
immSkipAttrib(color);
immAttrSkip(color);
immVertex2iv(pos, v1);
immAttrib3ubv(color, col_hi);
immAttr3ubv(color, col_hi);
immVertex2iv(pos, v2);
}

View File

@ -363,9 +363,9 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) {
UI_GetThemeColor3ubv(basecol + bezt->h1, col);
col[3] = fcurve_display_alpha(fcu) * 255;
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp);
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp + 3);
}
@ -373,9 +373,9 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
if (bezt->ipo == BEZT_IPO_BEZ) {
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
col[3] = fcurve_display_alpha(fcu) * 255;
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp + 3);
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp + 6);
}
}
@ -387,9 +387,9 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
fp = bezt->vec[0];
UI_GetThemeColor3ubv(basecol + bezt->h1, col);
col[3] = fcurve_display_alpha(fcu) * 255;
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp);
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp + 3);
}
@ -400,9 +400,9 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
fp = bezt->vec[1];
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
col[3] = fcurve_display_alpha(fcu) * 255;
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp);
immAttrib4ubv(color, col);
immAttr4ubv(color, col);
immVertex2fv(pos, fp + 3);
}
}

View File

@ -638,7 +638,7 @@ static void node_socket_circle_draw(const bContext *C, bNodeTree *ntree, Pointer
RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &ptr);
sock->typeinfo->draw_color((bContext *)C, &ptr, &node_ptr, color);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, sock->locx, sock->locy);
}

View File

@ -1341,29 +1341,29 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
tot_clip.xmax = v2d->tot.xmin + (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->over_border.xmax);
tot_clip.ymax = v2d->tot.ymin + (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->over_border.ymax);
immAttrib2f(texCoord, scene->ed->over_border.xmin, scene->ed->over_border.ymin);
immAttr2f(texCoord, scene->ed->over_border.xmin, scene->ed->over_border.ymin);
immVertex2f(pos, tot_clip.xmin, tot_clip.ymin);
immAttrib2f(texCoord, scene->ed->over_border.xmin, scene->ed->over_border.ymax);
immAttr2f(texCoord, scene->ed->over_border.xmin, scene->ed->over_border.ymax);
immVertex2f(pos, tot_clip.xmin, tot_clip.ymax);
immAttrib2f(texCoord, scene->ed->over_border.xmax, scene->ed->over_border.ymax);
immAttr2f(texCoord, scene->ed->over_border.xmax, scene->ed->over_border.ymax);
immVertex2f(pos, tot_clip.xmax, tot_clip.ymax);
immAttrib2f(texCoord, scene->ed->over_border.xmax, scene->ed->over_border.ymin);
immAttr2f(texCoord, scene->ed->over_border.xmax, scene->ed->over_border.ymin);
immVertex2f(pos, tot_clip.xmax, tot_clip.ymin);
}
else if (sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) {
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, v2d->tot.xmin, v2d->tot.ymin);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, v2d->tot.xmin, v2d->tot.ymax);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, v2d->tot.xmax, v2d->tot.ymax);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, v2d->tot.xmax, v2d->tot.ymin);
}
}
@ -1383,31 +1383,31 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
imagey = aspect / image_aspect;
}
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, -imagex, -imagey);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, -imagex, imagey);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, imagex, imagey);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, imagex, -imagey);
}
else {
draw_metadata = ((sseq->flag & SEQ_SHOW_METADATA) != 0);
immAttrib2f(texCoord, 0.0f, 0.0f);
immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, v2d->tot.xmin, v2d->tot.ymin);
immAttrib2f(texCoord, 0.0f, 1.0f);
immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, v2d->tot.xmin, v2d->tot.ymax);
immAttrib2f(texCoord, 1.0f, 1.0f);
immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, v2d->tot.xmax, v2d->tot.ymax);
immAttrib2f(texCoord, 1.0f, 0.0f);
immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, v2d->tot.xmax, v2d->tot.ymin);
}

View File

@ -824,9 +824,9 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
for (int axis_i = 0; axis_i < 3; axis_i++) {
int i = axis_order[axis_i];
immAttrib4ubv(col, axis_col[i]);
immAttr4ubv(col, axis_col[i]);
immVertex2f(pos, startx, starty);
immAttrib4ubv(col, axis_col[i]);
immAttr4ubv(col, axis_col[i]);
immVertex2fv(pos, axis_pos[i]);
}
@ -874,7 +874,7 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d)
immBegin(GPU_PRIM_LINE_STRIP, 3);
color[3] = 0; /* more transparent toward the ends */
immAttrib4ubv(col, color);
immAttr4ubv(col, color);
add_v3_v3v3(end, o, scaled_axis);
immVertex3fv(pos, end);
@ -884,11 +884,11 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d)
#endif
color[3] = 127; /* more opaque toward the center */
immAttrib4ubv(col, color);
immAttr4ubv(col, color);
immVertex3fv(pos, o);
color[3] = 0;
immAttrib4ubv(col, color);
immAttr4ubv(col, color);
sub_v3_v3v3(end, o, scaled_axis);
immVertex3fv(pos, end);
immEnd();
@ -913,7 +913,7 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d)
immBegin(GPU_PRIM_LINE_LOOP, ROT_AXIS_DETAIL);
color[3] = 63; /* somewhat faint */
immAttrib4ubv(col, color);
immAttr4ubv(col, color);
float angle = 0.0f;
for (int i = 0; i < ROT_AXIS_DETAIL; ++i, angle += step) {
float p[3] = {s * cosf(angle), s * sinf(angle), 0.0f};
@ -941,7 +941,7 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d)
immBindBuiltinProgram(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR);
GPU_point_size(5.0f);
immBegin(GPU_PRIM_POINTS, 1);
immAttrib4ubv(col, color);
immAttr4ubv(col, color);
immVertex3fv(pos, o);
immEnd();
immUnbindProgram();

View File

@ -58,30 +58,30 @@ GPUBatch *immBeginBatchAtMost(GPUPrimType, uint vertex_len);
/* Provide attribute values that can change per vertex. */
/* First vertex after immBegin must have all its attributes specified. */
/* Skipped attributes will continue using the previous value for that attr_id. */
void immAttrib1f(uint attr_id, float x);
void immAttrib2f(uint attr_id, float x, float y);
void immAttrib3f(uint attr_id, float x, float y, float z);
void immAttrib4f(uint attr_id, float x, float y, float z, float w);
void immAttr1f(uint attr_id, float x);
void immAttr2f(uint attr_id, float x, float y);
void immAttr3f(uint attr_id, float x, float y, float z);
void immAttr4f(uint attr_id, float x, float y, float z, float w);
void immAttrib2i(uint attr_id, int x, int y);
void immAttr2i(uint attr_id, int x, int y);
void immAttrib1u(uint attr_id, uint x);
void immAttr1u(uint attr_id, uint x);
void immAttrib2s(uint attr_id, short x, short y);
void immAttr2s(uint attr_id, short x, short y);
void immAttrib2fv(uint attr_id, const float data[2]);
void immAttrib3fv(uint attr_id, const float data[3]);
void immAttrib4fv(uint attr_id, const float data[4]);
void immAttr2fv(uint attr_id, const float data[2]);
void immAttr3fv(uint attr_id, const float data[3]);
void immAttr4fv(uint attr_id, const float data[4]);
void immAttrib3ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b);
void immAttrib4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void immAttr3ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b);
void immAttr4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void immAttrib3ubv(uint attr_id, const unsigned char data[4]);
void immAttrib4ubv(uint attr_id, const unsigned char data[4]);
void immAttr3ubv(uint attr_id, const unsigned char data[4]);
void immAttr4ubv(uint attr_id, const unsigned char data[4]);
/* Explicitly skip an attribute. */
/* This advanced option kills automatic value copying for this attr_id. */
void immSkipAttrib(uint attr_id);
void immAttrSkip(uint attr_id);
/* Provide one last attribute value & end the current vertex. */
/* This is most often used for 2D or 3D position (similar to glVertex). */

View File

@ -412,7 +412,7 @@ static void setAttribValueBit(uint attrib_id)
/* --- generic attribute functions --- */
void immAttrib1f(uint attrib_id, float x)
void immAttr1f(uint attrib_id, float x)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -430,7 +430,7 @@ void immAttrib1f(uint attrib_id, float x)
data[0] = x;
}
void immAttrib2f(uint attrib_id, float x, float y)
void immAttr2f(uint attrib_id, float x, float y)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -449,7 +449,7 @@ void immAttrib2f(uint attrib_id, float x, float y)
data[1] = y;
}
void immAttrib3f(uint attrib_id, float x, float y, float z)
void immAttr3f(uint attrib_id, float x, float y, float z)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -469,7 +469,7 @@ void immAttrib3f(uint attrib_id, float x, float y, float z)
data[2] = z;
}
void immAttrib4f(uint attrib_id, float x, float y, float z, float w)
void immAttr4f(uint attrib_id, float x, float y, float z, float w)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -490,7 +490,7 @@ void immAttrib4f(uint attrib_id, float x, float y, float z, float w)
data[3] = w;
}
void immAttrib1u(uint attrib_id, uint x)
void immAttr1u(uint attrib_id, uint x)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -507,7 +507,7 @@ void immAttrib1u(uint attrib_id, uint x)
data[0] = x;
}
void immAttrib2i(uint attrib_id, int x, int y)
void immAttr2i(uint attrib_id, int x, int y)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -525,7 +525,7 @@ void immAttrib2i(uint attrib_id, int x, int y)
data[1] = y;
}
void immAttrib2s(uint attrib_id, short x, short y)
void immAttr2s(uint attrib_id, short x, short y)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -543,22 +543,22 @@ void immAttrib2s(uint attrib_id, short x, short y)
data[1] = y;
}
void immAttrib2fv(uint attrib_id, const float data[2])
void immAttr2fv(uint attrib_id, const float data[2])
{
immAttrib2f(attrib_id, data[0], data[1]);
immAttr2f(attrib_id, data[0], data[1]);
}
void immAttrib3fv(uint attrib_id, const float data[3])
void immAttr3fv(uint attrib_id, const float data[3])
{
immAttrib3f(attrib_id, data[0], data[1], data[2]);
immAttr3f(attrib_id, data[0], data[1], data[2]);
}
void immAttrib4fv(uint attrib_id, const float data[4])
void immAttr4fv(uint attrib_id, const float data[4])
{
immAttrib4f(attrib_id, data[0], data[1], data[2], data[3]);
immAttr4f(attrib_id, data[0], data[1], data[2], data[3]);
}
void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b)
void immAttr3ub(uint attrib_id, uchar r, uchar g, uchar b)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -578,7 +578,7 @@ void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b)
data[2] = b;
}
void immAttrib4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a)
void immAttr4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a)
{
GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id;
#if TRUST_NO_ONE
@ -599,17 +599,17 @@ void immAttrib4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a)
data[3] = a;
}
void immAttrib3ubv(uint attrib_id, const uchar data[3])
void immAttr3ubv(uint attrib_id, const uchar data[3])
{
immAttrib3ub(attrib_id, data[0], data[1], data[2]);
immAttr3ub(attrib_id, data[0], data[1], data[2]);
}
void immAttrib4ubv(uint attrib_id, const uchar data[4])
void immAttr4ubv(uint attrib_id, const uchar data[4])
{
immAttrib4ub(attrib_id, data[0], data[1], data[2], data[3]);
immAttr4ub(attrib_id, data[0], data[1], data[2], data[3]);
}
void immSkipAttrib(uint attrib_id)
void immAttrSkip(uint attrib_id)
{
#if TRUST_NO_ONE
assert(attrib_id < imm.vertex_format.attr_len);
@ -652,49 +652,49 @@ static void immEndVertex(void) /* and move on to the next vertex */
void immVertex2f(uint attrib_id, float x, float y)
{
immAttrib2f(attrib_id, x, y);
immAttr2f(attrib_id, x, y);
immEndVertex();
}
void immVertex3f(uint attrib_id, float x, float y, float z)
{
immAttrib3f(attrib_id, x, y, z);
immAttr3f(attrib_id, x, y, z);
immEndVertex();
}
void immVertex4f(uint attrib_id, float x, float y, float z, float w)
{
immAttrib4f(attrib_id, x, y, z, w);
immAttr4f(attrib_id, x, y, z, w);
immEndVertex();
}
void immVertex2i(uint attrib_id, int x, int y)
{
immAttrib2i(attrib_id, x, y);
immAttr2i(attrib_id, x, y);
immEndVertex();
}
void immVertex2s(uint attrib_id, short x, short y)
{
immAttrib2s(attrib_id, x, y);
immAttr2s(attrib_id, x, y);
immEndVertex();
}
void immVertex2fv(uint attrib_id, const float data[2])
{
immAttrib2f(attrib_id, data[0], data[1]);
immAttr2f(attrib_id, data[0], data[1]);
immEndVertex();
}
void immVertex3fv(uint attrib_id, const float data[3])
{
immAttrib3f(attrib_id, data[0], data[1], data[2]);
immAttr3f(attrib_id, data[0], data[1], data[2]);
immEndVertex();
}
void immVertex2iv(uint attrib_id, const int data[2])
{
immAttrib2i(attrib_id, data[0], data[1]);
immAttr2i(attrib_id, data[0], data[1]);
immEndVertex();
}

View File

@ -89,35 +89,35 @@ void immRecti(uint pos, int x1, int y1, int x2, int y2)
void immRectf_fast_with_color(uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
{
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2f(pos, x1, y2);
}
void immRecti_fast_with_color(uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
{
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x2, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x1, y1);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x2, y2);
immAttrib4fv(col, color);
immAttr4fv(col, color);
immVertex2i(pos, x1, y2);
}
@ -425,16 +425,16 @@ void imm_draw_cylinder_fill_normal_3d(
n2[0] = cos2; n2[1] = sin2; n2[2] = 1 - n2[2];
/* first tri */
immAttrib3fv(nor, n2);
immAttr3fv(nor, n2);
immVertex3fv(pos, v1);
immVertex3fv(pos, v2);
immAttrib3fv(nor, n1);
immAttr3fv(nor, n1);
immVertex3fv(pos, v3);
/* second tri */
immVertex3fv(pos, v3);
immVertex3fv(pos, v4);
immAttrib3fv(nor, n2);
immAttr3fv(nor, n2);
immVertex3fv(pos, v1);
}
}

View File

@ -2053,16 +2053,16 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph
/* draw textured quad */
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0, 0);
immAttr2f(texCoord, 0, 0);
immVertex2f(pos, -radius, -radius);
immAttrib2f(texCoord, 1, 0);
immAttr2f(texCoord, 1, 0);
immVertex2f(pos, radius, -radius);
immAttrib2f(texCoord, 1, 1);
immAttr2f(texCoord, 1, 1);
immVertex2f(pos, radius, radius);
immAttrib2f(texCoord, 0, 1);
immAttr2f(texCoord, 0, 1);
immVertex2f(pos, -radius, radius);
immEnd();

View File

@ -106,16 +106,16 @@ void wm_stereo3d_draw_interlace(wmWindow *win, ARegion *ar)
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texcoord, halfx, halfy);
immAttr2f(texcoord, halfx, halfy);
immVertex2f(pos, ar->winrct.xmin, ar->winrct.ymin);
immAttrib2f(texcoord, 1.0f + halfx, halfy);
immAttr2f(texcoord, 1.0f + halfx, halfy);
immVertex2f(pos, ar->winrct.xmax + 1, ar->winrct.ymin);
immAttrib2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immAttr2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immVertex2f(pos, ar->winrct.xmax + 1, ar->winrct.ymax + 1);
immAttrib2f(texcoord, halfx, 1.0f + halfy);
immAttr2f(texcoord, halfx, 1.0f + halfy);
immVertex2f(pos, ar->winrct.xmin, ar->winrct.ymax + 1);
immEnd();
@ -190,16 +190,16 @@ void wm_stereo3d_draw_sidebyside(wmWindow *win, int view)
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texcoord, halfx, halfy);
immAttr2f(texcoord, halfx, halfy);
immVertex2f(pos, soffx, 0.0f);
immAttrib2f(texcoord, 1.0f + halfx, halfy);
immAttr2f(texcoord, 1.0f + halfx, halfy);
immVertex2f(pos, soffx + (sizex * 0.5f), 0.0f);
immAttrib2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immAttr2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immVertex2f(pos, soffx + (sizex * 0.5f), sizey);
immAttrib2f(texcoord, halfx, 1.0f + halfy);
immAttr2f(texcoord, halfx, 1.0f + halfy);
immVertex2f(pos, soffx, sizey);
immEnd();
@ -234,16 +234,16 @@ void wm_stereo3d_draw_topbottom(wmWindow *win, int view)
immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texcoord, halfx, halfy);
immAttr2f(texcoord, halfx, halfy);
immVertex2f(pos, 0.0f, soffy);
immAttrib2f(texcoord, 1.0f + halfx, halfy);
immAttr2f(texcoord, 1.0f + halfx, halfy);
immVertex2f(pos, sizex, soffy);
immAttrib2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immAttr2f(texcoord, 1.0f + halfx, 1.0f + halfy);
immVertex2f(pos, sizex, soffy + (sizey * 0.5f));
immAttrib2f(texcoord, halfx, 1.0f + halfy);
immAttr2f(texcoord, halfx, 1.0f + halfy);
immVertex2f(pos, 0.0f, soffy + (sizey * 0.5f));
immEnd();