feat: P.0.lib.render colored-quad tile-grid renderer

This commit is contained in:
Axel Meyer
2026-05-09 20:09:00 +02:00
commit 654c038030
4 changed files with 94 additions and 0 deletions

30
README.md Normal file
View File

@@ -0,0 +1,30 @@
# lib-core.render
P.0 colored-quad tile-grid renderer. Reads `lib-core.maps`'s current map +
its tilemap, iterates tiles, draws a colored rect per tile via
`engine.render.draw_rect`. Fallback to magenta `[255, 0, 255]` for tiles
with missing/malformed color.
- Lib-ID: `lib-core.render`
- Version: `0.1.0`
- Spec: `meta/docs/superpowers/specs/2026-05-09-p0-lib-render-design.md`
Forward-compat stubs (DEPRECATED-MVP) for texture-rendering,
PROTOTYPE-Lib-Pattern, camera, layers, post-processing, parallax,
shaders, hot-reload. See `meta/docs/architecture/render-pipeline.md`
for the full target spec (941 lines).
## API
- `r_lib.draw_map(map_id?)` — iterates current (or specified) map's tiles,
draws colored rect per tile. Must be called inside a render hook.
Returns count of tiles drawn.
## Consumer pattern
```lua
local maps = require("lib-core.maps")
local r_lib = require("lib-core.render")
function render(ctx)
engine.render.clear_color(engine.render.rgb(20, 20, 30))
r_lib.draw_map()
end
```