Files
sx/examples/33-stb-image.sx
2026-02-22 17:24:04 +02:00

17 lines
374 B
Plaintext

#import "modules/std.sx";
stb :: #import "modules/stb.sx";
main :: () -> s32 {
w: s32 = 0;
h: s32 = 0;
ch: s32 = 0;
img := stb.stbi_load("test.png", @w, @h, @ch, 4);
if xx img != 0 {
print("loaded {}x{} ({} channels)\n", w, h, ch);
stb.stbi_image_free(xx img);
} else {
print("no image (expected in test)\n");
}
0;
}