stbi: fix loading image from memory (#15981)

This commit is contained in:
locriacyber 2022-10-07 14:20:35 +00:00 committed by GitHub
parent 03f82d5f68
commit 07d5612347
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -227,8 +227,9 @@ pub fn (mut ctx Context) create_image_from_memory(buf &u8, bufsize int) Image {
ok: stb_img.ok
data: stb_img.data
ext: stb_img.ext
id: ctx.image_cache.len
}
img.init_sokol_image()
img.id = ctx.image_cache.len
ctx.image_cache << img
return img
}