nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
25.83k stars 7.66k forks source link

Added general error code enum when STBI_NO_FAILURE_STRINGS is defined #1600

Open milkmull opened 5 months ago

milkmull commented 5 months ago

I thought it would be useful to have an error code enum in the case that STBI_NO_FAILURE_STRINGS is defined. In my case, I did not want to compile all of the strings but I still wanted to provide general feedback on failure types. Using an enum has the added benefit of allowing users to switch on the error and possibly provide their own failure reason strings.

I tried to keep the changes as unintrusive as possible. If I need to change or revise anything or if anyone has any suggestions for improvements please let me know!