5 ex_atlas_8c example
gullradriel edited this page 2026-10-09 00:51:57 +02:00

ex_atlas.c

n_atlas multi-page sprite atlas test (headless). Builds a 64x32 image in memory, encodes it to PNG, and loads it as a 4x2 cell grid. Everything asserted here needs no display: cell geometry is derived from the bitmap and the grid, so it can be checked without drawing.

The refusals matter as much as the happy path. A cell index past the end of the grid must report failure rather than blit garbage from the next row, and a caller handed FALSE can fall back to something sensible (literal text for a missing glyph, the previous atlas for a bad page).