6be660fac6
Modo de captura que renderiza cada demo de la gallery en una ventana GLFW
invisible (GLFW_VISIBLE=GLFW_FALSE) y guarda PNG por demo via stb_image_write.
- capture.{h,cpp}: API gallery::run_capture(cfg, items) — warmup_frames,
glReadPixels(GL_RGBA), flip vertical, stbi_write_png.
- main.cpp: parsea --capture <dir> antes de fn::run_app y delega a capture.cpp.
- vendor: stb_image_write.h v1.16 (mismo commit que stb_image.h).
Funciona en WSL con LIBGL_ALWAYS_SOFTWARE=1 (Mesa/llvmpipe). Si el entorno
no tiene contexto GL, el binario sale con rc!=0 sin generar PNGs.
Issue 0048.
stb (vendored)
Cabeceras header-only de nothings/stb, dominio publico (MIT-0 / unlicense).
Pinned
stb_image.h— v2.30 — commitf0569113c93ad095470c54bf34a17b36646bbbb5
Layout
stb_image.h— header de stb (no modificar).stb_image_impl.cpp— UNICO traductor de la implementacion. DefineSTB_IMAGE_IMPLEMENTATIONantes del include para que el cuerpo de stb_image se emita una sola vez en todo el binario.
Uso
Incluir <stb_image.h> desde cualquier .cpp del proyecto sin definir STB_IMAGE_IMPLEMENTATION. Solo stb_image_impl.cpp define el simbolo, evitando duplicados al linkar.
Las funciones del registry que envuelven stb_image viven en cpp/functions/gfx/ (p.ej. gl_texture_load).
Actualizar
cd cpp/vendor/stb
curl -L -o stb_image.h https://raw.githubusercontent.com/nothings/stb/<COMMIT>/stb_image.h
# Actualizar el commit en este README.