Skip to content

cf_draw_custom_shape

Category: draw
GitHub: cute_draw.h


Draws the outline of a registered custom SDF shape.

void cf_draw_custom_shape(CF_CustomShape shape, CF_Aabb bounds, float thickness, const float* params, int param_count);
Parameters Description
shape The shape from cf_make_custom_shape.
bounds World-space bounds containing the whole shape (the renderer pads for
stroke and antialias). Nothing outside them is drawn.
thickness The thickness of the outline stroke.
params Up to 16 floats delivered to the sdf as ShapeParams (a.x, a.y, b.x, ...).
param_count Number of floats in params.

Remarks

Unlike the built-in closed shapes, the stroke straddles the sdf's zero isoline (half the thickness on each side): a user sdf may be unsigned, with no inside for the stroke to run into.

CF_CustomShape
cf_make_custom_shape
cf_draw_custom_shape_fill