Skip to content

v3.7.1 polygon support, re-weigthed fonts (better compression), bug fixes

Latest

Choose a tag to compare

@Geolm Geolm released this 18 Nov 13:57
· 9 commits to main since this release

onedraw 3.7.1

New

  • od_draw_polygon() — filled polygon primitive (in-shader SDF, sdPolygon).
    • Closed loop of x, y pairs, max OD_MAX_POLYGON_VERTICES (255) vertices.
    • Any winding, concave and self-intersecting loops are fine (odd-even rule); optional corner rounding, like od_draw_triangle.
    • Holes / multi-part shapes are separate calls.
    • Note: the polygon is culled by its bounding box only and every pixel of the touched tiles evaluates all its edges — keep polygons small (few vertices, compact bbox) and split large ones.

Fixed

  • Font atlas upload is now a pure GPU→GPU path: the GPU decodes the packed atlas and a blit copies the blocks into the texture in the same command buffer (ordered by the queue, no CPU readback of decoded data). This removes the rare, timing-dependent font corruption where the CPU copy raced the decode. A failed decode is now logged instead of failing silently.
    • Requires the explicit (width/4)*8 blit pitch — a zero pitch re-interprets the compressed block grid and scrambles the atlas.
  • od_draw_string_view(): empty baked glyphs (space) no longer emit a character command, the pen still advances.

Fonts (visual change)

  • Baked families re-weighted: regular → Satoshi Medium, bold → Satoshi Black, mono → JetBrains Mono Medium. Text renders slightly heavier than in 3.6.x.
  • Compressed atlas size reduced 786 KB → 666 KB (bc_packed 2.0.0 → 2.1.5).

Build & misc

  • lib/shaders.h is stamped with a hash of the shader sources + compile flags, so rebuilds no longer rewrite the header when nothing changed.
  • Pre-build builder now parses its arguments with flag.h.
  • Updated stb libraries (stb_truetype, stb_rect_pack).

API changes

  • One new function (od_draw_polygon) and one new constant (OD_MAX_POLYGON_VERTICES) — no breaking changes.