Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I am angry, I lost 2 days for this library. Now I am sure IT ISN'T POSSIBLE TO LOAD JPG/BMP/PNG FILES using this library IN VISUAL STUDIO 2010 !! ilLoadImage throws error: IL_INVALID_EXTENSION ! Am I lonly with this error - NO - here are relative topics:
and much more
What are doing authors to correct this bug ? ANSWER: NOTHING ! I have been written to them and 0 answer.
Now I use SDL library which works !
I have feeling this library isn't being maintained - which is a shame since its the only one that seems to load/save psd and dds files.
I think the problem the OP was running into is an incompatibility with wchar_t * in the loadimage function. For some reason, it requires a const wchar_t* parameter, but then treats the string as a regular const char* internally. SO… if you wish to get images to load, pass in a const char string and cast it to wchar_t* like this:
ilLoadImage((const ILstring) "C:\\ImageFiles\\image.jpg")
ILstring is defined as wchar_t*, so this is a const wchar_t* cast.
This also applies to the ilSaveImage function.
Since this is dubious from a safety standpoint, you might want to look at the ilLoadF functions instead and handle the filenames yourself. Can't help you there with specifics though, since the documentation hasn't been good enough for me to figure out how to get that to work either.