Open SafwatHalaby opened 9 years ago
I'm not sure at this point how we are building SDL image. I guess we aren't linking in libpng, and instead rely on browser decoding, which is asynchronous. I assume that's the reason for this confusion, but I'm not sure.
PNG's are not the specific cause. Swap the flag with int imgFlags = IMG_INIT_WEBP
and you'd get the same error, WEBP images are not supported
, this is true for any flag.
And by the way, all image types are in fact supported, as long as the user does not call IMG_init
.
https://github.com/kripken/emscripten/pull/3831 addresses part of this, by giving an option to use libpng etc.
This will always print the following message to the console
Interestingly, simply not calling IMG_Init makes everything work in Emscripten. Even more interestingly, whether one calls IMG_Init or not has no effect at all in NATIVE sdl2.
I don't know what to make of it. But at the very least, the Emscripten port should spit something like "You don't need to call IMG_Init" rather than just throw a confusing unrelated error.