IMG_Load() not working under Windows CE SOLVED


I have started my debugger, jumping to IMG_isPNG() and see that the function
has no body - and I cried What the f*** is going on here?

And yes, the function body was really empty, because in each these IMG_LoadXXX
is testing macro condition

#ifdef LOAD_PNG …

which is however not defined. I assume those macros are defined in project file
(which is missing for VisualCE)

So I had to define those macros and it works fine now however I wonder why
there is this macro condition.

I assume this crazy macro test is due to spare some binary code (and memory) if
targeted image is not used in our program.

If I were to guess I’d say it’s probably to make it easier to port SDL_Image to new
platforms. You now have a file that will compile and run properly under all
circumstances before you even start implementing the file loading and conversion
stuff. And once you get each individual routine working, you can enable it and leave
the ones you haven’t implemented yet disabled, and the DLL will continue to work
without causing compile-time or runtime errors.>----- Original Message ----

From: Techi
Subject: Re: [SDL] IMG_Load() not working under Windows CE SOLVED