Blender  V2.93
Functions
GPU_immediate_util.h File Reference

Go to the source code of this file.

Functions

void immRectf (uint pos, float x1, float y1, float x2, float y2)
 
void immRecti (uint pos, int x1, int y1, int x2, int y2)
 
void immRectf_fast (uint pos, float x1, float y1, float x2, float y2)
 
void immRectf_fast_with_color (uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
 
void immRecti_fast_with_color (uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
 
void imm_cpack (uint x)
 
void imm_draw_circle_wire_2d (uint shdr_pos, float x, float y, float radius, int nsegments)
 
void imm_draw_circle_fill_2d (uint shdr_pos, float x, float y, float radius, int nsegments)
 
void imm_draw_circle_wire_aspect_2d (uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
 
void imm_draw_circle_fill_aspect_2d (uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
 
void imm_draw_circle_wire_3d (uint pos, float x, float y, float radius, int nsegments)
 
void imm_draw_circle_dashed_3d (uint pos, float x, float y, float radius, int nsegments)
 
void imm_draw_circle_fill_3d (uint pos, float x, float y, float radius, int nsegments)
 
void imm_draw_circle_partial_wire_2d (uint pos, float x, float y, float radius, int nsegments, float start, float sweep)
 
void imm_draw_disk_partial_fill_2d (uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
 
void imm_draw_box_wire_2d (uint pos, float x1, float y1, float x2, float y2)
 
void imm_draw_box_wire_3d (uint pos, float x1, float y1, float x2, float y2)
 
void imm_draw_box_checker_2d_ex (float x1, float y1, float x2, float y2, const float color_primary[4], const float color_secondary[4], int checker_size)
 
void imm_draw_box_checker_2d (float x1, float y1, float x2, float y2)
 
void imm_draw_cube_fill_3d (uint pos, const float co[3], const float aspect[3])
 
void imm_draw_cube_wire_3d (uint pos, const float co[3], const float aspect[3])
 
void imm_draw_cylinder_fill_normal_3d (uint pos, uint nor, float base, float top, float height, int slices, int stacks)
 
void imm_draw_cylinder_wire_3d (uint pos, float base, float top, float height, int slices, int stacks)
 
void imm_draw_cylinder_fill_3d (uint pos, float base, float top, float height, int slices, int stacks)
 

Detailed Description

Utility drawing functions (rough equivalent to OpenGL's GLU)

Definition in file GPU_immediate_util.h.

Function Documentation

◆ imm_cpack()

void imm_cpack ( uint  x)

Pack color into 3 bytes

This define converts a numerical value to the equivalent 24-bit color, while not being endian-sensitive. On little-endian, this is the same as doing a 'naive' indexing, on big-endian, it is not!

Note
BGR format (i.e. 0xBBGGRR)...
Parameters
xcolor.

Definition at line 157 of file gpu_immediate_util.c.

References immUniformColor3ub(), and x.

Referenced by curve_draw_stroke_3d().

◆ imm_draw_box_checker_2d()

void imm_draw_box_checker_2d ( float  x1,
float  y1,
float  x2,
float  y2 
)

◆ imm_draw_box_checker_2d_ex()

void imm_draw_box_checker_2d_ex ( float  x1,
float  y1,
float  x2,
float  y2,
const float  color_primary[4],
const float  color_secondary[4],
int  checker_size 
)

◆ imm_draw_box_wire_2d()

void imm_draw_box_wire_2d ( uint  pos,
float  x1,
float  y1,
float  x2,
float  y2 
)

◆ imm_draw_box_wire_3d()

void imm_draw_box_wire_3d ( uint  pos,
float  x1,
float  y1,
float  x2,
float  y2 
)

Definition at line 350 of file gpu_immediate_util.c.

References GPU_PRIM_LINE_LOOP, immBegin(), immEnd(), immVertex3f(), pos, x2, and y1.

◆ imm_draw_circle_dashed_3d()

void imm_draw_circle_dashed_3d ( uint  pos,
float  x,
float  y,
float  radius,
int  nsegments 
)

Definition at line 321 of file gpu_immediate_util.c.

References GPU_PRIM_LINES, imm_draw_circle_3D(), pos, x, and y.

Referenced by SCULPT_cloth_simulation_limits_draw().

◆ imm_draw_circle_fill_2d()

void imm_draw_circle_fill_2d ( uint  shdr_pos,
float  x,
float  y,
float  rad,
int  nsegments 
)

Draw a filled circle with the given radius. The circle is centered at x, y and drawn in the XY plane.

Parameters
shdr_posThe vertex attribute number for position.
xHorizontal center.
yVertical center.
radThe circle's radius.
nsegmentsThe number of segments to use in drawing (more = smoother).

Definition at line 203 of file gpu_immediate_util.c.

References GPU_PRIM_TRI_FAN, imm_draw_circle(), x, and y.

Referenced by annotation_draw_eraser(), button2d_geom_draw_backdrop(), dial_geom_draw(), ED_gpencil_brush_draw_eraser(), gpencil_brush_cursor_draw(), gpencil_draw_eraser(), move_geom_draw(), radial_control_paint_cursor(), radial_control_paint_tex(), ui_hsv_cursor(), and wm_gesture_draw_circle().

◆ imm_draw_circle_fill_3d()

void imm_draw_circle_fill_3d ( uint  pos,
float  x,
float  y,
float  radius,
int  nsegments 
)

Definition at line 326 of file gpu_immediate_util.c.

References GPU_PRIM_TRI_FAN, imm_draw_circle_3D(), pos, x, and y.

Referenced by arrow_draw_geom(), and cursor_draw_point_screen_space().

◆ imm_draw_circle_fill_aspect_2d()

void imm_draw_circle_fill_aspect_2d ( uint  shdr_pos,
float  x,
float  y,
float  rad_x,
float  rad_y,
int  nsegments 
)

Definition at line 213 of file gpu_immediate_util.c.

References GPU_PRIM_TRI_FAN, imm_draw_circle(), x, and y.

Referenced by cage2d_draw_circle_handles().

◆ imm_draw_circle_partial_wire_2d()

void imm_draw_circle_partial_wire_2d ( uint  pos,
float  x,
float  y,
float  radius,
int  nsegments,
float  start,
float  sweep 
)

Definition at line 242 of file gpu_immediate_util.c.

References GPU_PRIM_LINE_STRIP, imm_draw_circle_partial(), pos, x, and y.

Referenced by dial_geom_draw().

◆ imm_draw_circle_wire_2d()

void imm_draw_circle_wire_2d ( uint  shdr_pos,
float  x,
float  y,
float  rad,
int  nsegments 
)

Draw a circle outline with the given radius. The circle is centered at x, y and drawn in the XY plane.

Parameters
shdr_posThe vertex attribute number for position.
xHorizontal center.
yVertical center.
radThe circle's radius.
nsegmentsThe number of segments to use in drawing (more = smoother).

Definition at line 188 of file gpu_immediate_util.c.

References GPU_PRIM_LINE_LOOP, imm_draw_circle(), x, and y.

Referenced by annotation_draw_eraser(), annotation_draw_stabilizer(), brush_drawcursor(), button2d_geom_draw_backdrop(), dial_geom_draw(), ED_gpencil_brush_draw_eraser(), gpencil_brush_cursor_draw(), gpencil_draw_eraser(), move_geom_draw(), paint_draw_2D_view_brush_cursor(), radial_control_paint_cursor(), tracking_segment_knot_cb(), ui_draw_but_HSVCIRCLE(), ui_draw_but_UNITVEC(), ui_draw_pie_center(), ui_hsv_cursor(), and wm_gesture_draw_circle().

◆ imm_draw_circle_wire_3d()

void imm_draw_circle_wire_3d ( uint  pos,
float  x,
float  y,
float  radius,
int  nsegments 
)

◆ imm_draw_circle_wire_aspect_2d()

void imm_draw_circle_wire_aspect_2d ( uint  shdr_pos,
float  x,
float  y,
float  rad_x,
float  rad_y,
int  nsegments 
)

Definition at line 208 of file gpu_immediate_util.c.

References GPU_PRIM_LINE_LOOP, imm_draw_circle(), x, and y.

Referenced by cage2d_draw_circle_handles().

◆ imm_draw_cube_fill_3d()

void imm_draw_cube_fill_3d ( uint  pos,
const float  co[3],
const float  aspect[3] 
)

◆ imm_draw_cube_wire_3d()

void imm_draw_cube_wire_3d ( uint  pos,
const float  co[3],
const float  aspect[3] 
)

◆ imm_draw_cylinder_fill_3d()

void imm_draw_cylinder_fill_3d ( uint  pos,
float  base,
float  top,
float  height,
int  slices,
int  stacks 
)

Definition at line 537 of file gpu_immediate_util.c.

References cosf, float(), GPU_PRIM_TRIS, height, immBegin(), immEnd(), immVertex3fv(), M_PI, pos, sinf, top, v1, and v2.

Referenced by arrow_draw_geom().

◆ imm_draw_cylinder_fill_normal_3d()

void imm_draw_cylinder_fill_normal_3d ( uint  pos,
uint  nor,
float  base,
float  top,
float  height,
int  slices,
int  stacks 
)

Draw a cylinder. Replacement for gluCylinder. warning : Slow, better use it only if you no other choices.

Parameters
posThe vertex attribute number for position.
norThe vertex attribute number for normal.
baseSpecifies the radius of the cylinder at z = 0.
topSpecifies the radius of the cylinder at z = height.
heightSpecifies the height of the cylinder.
slicesSpecifies the number of subdivisions around the z axis.
stacksSpecifies the number of subdivisions along the z axis.

Definition at line 443 of file gpu_immediate_util.c.

References cosf, float(), GPU_PRIM_TRIS, height, immAttr3fv(), immBegin(), immEnd(), immVertex3fv(), M_PI, nor, normalize_v3(), pos, sinf, sub_v3_v3v3(), top, v1, and v2.

◆ imm_draw_cylinder_wire_3d()

void imm_draw_cylinder_wire_3d ( uint  pos,
float  base,
float  top,
float  height,
int  slices,
int  stacks 
)

Definition at line 499 of file gpu_immediate_util.c.

References cosf, float(), GPU_PRIM_LINES, height, immBegin(), immEnd(), immVertex3fv(), M_PI, pos, sinf, top, v1, and v2.

◆ imm_draw_disk_partial_fill_2d()

void imm_draw_disk_partial_fill_2d ( uint  pos,
float  x,
float  y,
float  rad_inner,
float  rad_outer,
int  nsegments,
float  start,
float  sweep 
)

Draw a filled arc with the given inner and outer radius. The circle is centered at x, y and drawn in the XY plane.

Note
Arguments are gluPartialDisk compatible.
Parameters
posThe vertex attribute number for position.
xHorizontal center.
yVertical center.
rad_innerThe inner circle's radius.
rad_outerThe outer circle's radius (can be zero).
nsegmentsThe number of segments to use in drawing (more = smoother).
startSpecifies the starting angle, in degrees, of the disk portion.
sweepSpecifies the sweep angle, in degrees, of the disk portion.

Definition at line 292 of file gpu_immediate_util.c.

References GPU_PRIM_TRI_STRIP, imm_draw_disk_partial(), pos, x, and y.

Referenced by dial_geom_draw(), and dial_ghostarc_draw().

◆ immRectf()

void immRectf ( uint  pos,
float  x1,
float  y1,
float  x2,
float  y2 
)

◆ immRectf_fast()

void immRectf_fast ( uint  pos,
float  x1,
float  y1,
float  x2,
float  y2 
)

Definition at line 87 of file gpu_immediate_util.c.

References immVertex2f(), pos, x2, and y1.

Referenced by timeline_cache_draw_cached_segments().

◆ immRectf_fast_with_color()

void immRectf_fast_with_color ( uint  pos,
uint  col,
float  x1,
float  y1,
float  x2,
float  y2,
const float  color[4] 
)

Definition at line 98 of file gpu_immediate_util.c.

References col, immAttr4fv(), immVertex2f(), pos, x2, and y1.

◆ immRecti()

void immRecti ( uint  pos,
int  x1,
int  y1,
int  x2,
int  y2 
)

◆ immRecti_fast_with_color()

void immRecti_fast_with_color ( uint  pos,
uint  col,
int  x1,
int  y1,
int  x2,
int  y2,
const float  color[4] 
)

Definition at line 116 of file gpu_immediate_util.c.

References col, immAttr4fv(), immVertex2i(), pos, x2, and y1.