Skip to content

cf_draw3d_push_texture

Category: draw3d
GitHub: cute_draw3d.h


Textures subsequent mesh submissions with a sprite's current frame.

void cf_draw3d_push_texture(const CF_Sprite* sprite);
Parameters Description
sprite The sprite whose current frame supplies the image.

Remarks

The image participates in CF's texture atlas exactly like 2d sprite drawing, so many meshes with many different images still coalesce into few instanced draws -- and an animated sprite animates on the mesh. The shader receives the atlas page as u_image and the frame's sub-rect as in_uv_rect; mesh UVs must lie in [0, 1]. For tiling UVs or hand-managed textures use cf_draw3d_set_texture instead.

CF_Sprite
cf_draw3d_pop_texture
cf_draw3d_peek_texture
cf_draw3d_set_texture
cf_draw3d_mesh