The stb headers move from the repo-root vendors/ (resolvable only with CWD = sx repo) into library/vendors/ following the sqlite convention — bindings module + c/ sources + provenance README — so '#import "vendors/stb_image/stb_image.sx"' (image v2.30 + image_write v1.16) and '#import "vendors/stb_truetype/stb_truetype.sx"' (v1.26) work from any consumer via the stdlib search paths. modules/ffi/stb.sx dissolves into the stb_image vendor; modules/ffi/stb_truetype.sx keeps its non-stb text-shaping companions and re-imports the vendored unit. examples/1625 pins a deterministic in-memory BMP decode; examples/1626 pins font init + metric invariants against the system Helvetica.
20 lines
778 B
Plaintext
20 lines
778 B
Plaintext
// =====================================================================
|
|
// vendors/stb_image — Sean Barrett's stb_image (decode) and
|
|
// stb_image_write (encode) as one `#import c` unit (c/, see README.md
|
|
// for versions + provenance).
|
|
//
|
|
// `#import "vendors/stb_image/stb_image.sx"` gives any sx program
|
|
// image decode/encode with no system dependency and no build flags:
|
|
// the decls are synthesized from the headers, and the implementation
|
|
// compiles through sx's content-addressed object cache — once per
|
|
// machine, not once per run.
|
|
// =====================================================================
|
|
|
|
#import c {
|
|
#include "c/stb_image.h";
|
|
#source "c/stb_image_impl.c";
|
|
|
|
#include "c/stb_image_write.h";
|
|
#source "c/stb_image_write_impl.c";
|
|
};
|