Loading Icons: Difference between revisions

Don't link to ancient version of stb_image that doesn't even have the functions this references.
[unchecked revision][unchecked revision]
mNo edit summary
(Don't link to ancient version of stb_image that doesn't even have the functions this references.)
Line 129:
Using these is not a simple thing to do. Definitely more complex than those ca. 80 SLoC above. You could port libpng, libjpeg, etc. but that's not an easy task either. They usually have their dependencies on their own, including setjmp and longjmp, and it is not trivial to use libpng's API for example.
 
Instead, use [https://webgithub.archive.orgcom/webnothings/20070923112451stb/http:blob//nothings.orgmaster/stb_image.h stb_image.h]. This is a single header file (no library linking needed, just libc), which is easy to use, for example the code to load PNG images looks like this:
<source lang="c">
#define STBI_IMPLEMENTATION
Anonymous user