Sample for using stb_image

744 views
Skip to first unread message

Björn K.

unread,
May 19, 2015, 5:28:36 AM5/19/15
to emscripte...@googlegroups.com
Hi there!

Is there any example where I can see how to use stbi_load_from_memory when compiling with emcc -s STB_IMAGE=1?

Best regards,
Björn

Alon Zakai

unread,
May 19, 2015, 1:53:37 PM5/19/15
to emscripte...@googlegroups.com
tests/sdl_stb_image*.c show how that option lets SDL use it internally and automatically. If you want to call the stbi_* methods directly, that should be possible, I guess you'd need to read the stb header file to see. Can also look inside src/library_sdl.js to see how it calls those methods internally.


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Björn K.

unread,
May 20, 2015, 3:12:24 AM5/20/15
to emscripte...@googlegroups.com
Thanks a lot! I already had a look at the test-files and wondered what that file should have to do with stb_image, but as you're saying now that when using the switch it internally lets the sdl-calls use stb_image everything makes sense!

Best regards,
Björn


Am Dienstag, 19. Mai 2015 19:53:37 UTC+2 schrieb Alon Zakai:
tests/sdl_stb_image*.c show how that option lets SDL use it internally and automatically. If you want to call the stbi_* methods directly, that should be possible, I guess you'd need to read the stb header file to see. Can also look inside src/library_sdl.js to see how it calls those methods internally.

On Tue, May 19, 2015 at 2:28 AM, Björn K. <bjoern.ko...@googlemail.com> wrote:
Hi there!

Is there any example where I can see how to use stbi_load_from_memory when compiling with emcc -s STB_IMAGE=1?

Best regards,
Björn

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages