DevIL Documentation | Home | Previous | Next |
These functions load a specific type of image from a file, file handle or memory "lump".
ILboolean ilLoad(
ILenum Type,
char *FileName
);
ILboolean ilLoadF(
ILenum Type,
ILHANDLE File
);
ILboolean ilLoadL(
ILenum Type,
ILvoid *Lump,
ILuint Size
);
ilLoad can be used much in the same way ilLoadImage is used, except with ilLoad, it is possible to force OpenIL to load a file as a specific image format, no matter what the extension. ilLoadF is useful for when an image is being read from some type of resource or .pak-type file, as is ilLoadL. To provide support for other languages than C/C++, ilSetFileCallbacks was introduced to allow loading from file handles in these languages via ilLoadF.
Due to limitations in the external libraries used, ilLoadF and ilLoadL do not support all the formats ilLoad does. ilLoadF is missing support for IL_TIF images. ilLoadL also lacks support for the IL_TIF format.
IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_COULD_NOT_OPEN_FILE - The file pointed to by FileName could not be opened. Either the file does not exist or is in use by another process.
IL_INVALID_ENUM - Type was of an invalid value.
IL_INVALID_PARAM - FileName, File or Lump was NULL.
IL_INVALID_FILE_HEADER - The file had an invalid header and could not be loaded.
IL_ILLEGAL_FILE_VALUE - The file could not be loaded due to an invalid value present.
IL_OUT_OF_MEMORY - Could not allocate memory for the new image data.
IL_LIB_JPEG_ERROR - Error occurred when trying to load a jpeg.
IL_LIB_PNG_ERROR - Error occurred when trying to load a png.
ilGenImages, ilBindImage, ilLoadImage, ilSave, ilSaveImage, ilSetFileCallbacks