PDA

Voir la version compl鋈e : [無ibrary][Aide] Any error handler in load functions?


theNinjaBunny
26/03/2007, 17h44
Is there any error handler in load functions? I searched in Doxygen but not found.

If you try to load a image but it doesn't exist... what happened? nothing? is there any way to know that the imagen isn't loaded?

Brunni
26/03/2007, 19h00
ulLoadImageFile (for example) returns an object of type UL_IMAGE. If the image doesn't exist, it returns NULL. You should never use a NULL image. Here is a simple check:
UL_IMAGE *img;
img = ulLoadImageFilePNG(...);
if (!img)
{
[image could not be loaded, you can show an error]
}
Same with ulRealizeImage / ulUnrealizeImage: always check the return value to know if it has been done properly (0 = failure) ;)