Skip to content

cf_draw_canvas

Category: draw
GitHub: cute_draw.h


Draws a canvas.

void cf_draw_canvas(CF_Canvas canvas, CF_V2 position, CF_V2 scale);
Parameters Description
canvas The canvas to draw.
position The position to draw at.
scale The scale of the canvas, w/h.

Remarks

This function creates an entire dedicated draw call internally. This means it's a fairly expensive function, so be sure to use it sparingly. If you apply a custom shader you may read pixels from the canvas as it's draw by texture(u_image, v_uv). Feel free to copy v_uv into your own vec2 uv = v_uv; and sample from the canvas as-needed.

cf_app_draw_onto_screen
cf_render_to