import c
This commit is contained in:
16
examples/33-stb-image.sx
Normal file
16
examples/33-stb-image.sx
Normal file
@@ -0,0 +1,16 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user