Attempts to load an image from a file. The file format is specified by the user. ! \param Type Format of this file. Acceptable values are IL_BLP, IL_BMP, IL_CUT, IL_DCX, IL_DDS, IL_DICOM, IL_DOOM, IL_DOOM_FLAT, IL_DPX, IL_EXR, IL_FITS, IL_FTX, IL_GIF, IL_HDR, IL_ICO, IL_ICNS, IL_IFF, IL_IWI, IL_JP2, IL_JPG, IL_LIF, IL_MDL, IL_MNG, IL_MP3, IL_PCD, IL_PCX, IL_PIX, IL_PNG, IL_PNM, IL_PSD, IL_PSP
| 958 | \return Boolean value of failure or success. Returns IL_FALSE if all three loading methods |
| 959 | have been tried and failed.*/ |
| 960 | ILboolean ILAPIENTRY ilLoad(ILenum Type, ILconst_string FileName) |
| 961 | { |
| 962 | ILboolean bRet; |
| 963 | |
| 964 | if (FileName == NULL || ilStrLen(FileName) < 1) { |
| 965 | ilSetError(IL_INVALID_PARAM); |
| 966 | return IL_FALSE; |
| 967 | } |
| 968 | |
| 969 | switch (Type) |
| 970 | { |
| 971 | case IL_TYPE_UNKNOWN: |
| 972 | bRet = ilLoadImage(FileName); |
| 973 | break; |
| 974 | |
| 975 | #ifndef IL_NO_TGA |
| 976 | case IL_TGA: |
| 977 | bRet = ilLoadTarga(FileName); |
| 978 | break; |
| 979 | #endif |
| 980 | |
| 981 | #ifndef IL_NO_JPG |
| 982 | case IL_JPG: |
| 983 | bRet = ilLoadJpeg(FileName); |
| 984 | break; |
| 985 | #endif |
| 986 | |
| 987 | #ifndef IL_NO_JP2 |
| 988 | case IL_JP2: |
| 989 | bRet = ilLoadJp2(FileName); |
| 990 | break; |
| 991 | #endif |
| 992 | |
| 993 | #ifndef IL_NO_DDS |
| 994 | case IL_DDS: |
| 995 | bRet = ilLoadDds(FileName); |
| 996 | break; |
| 997 | #endif |
| 998 | |
| 999 | #ifndef IL_NO_PNG |
| 1000 | case IL_PNG: |
| 1001 | bRet = ilLoadPng(FileName); |
| 1002 | break; |
| 1003 | #endif |
| 1004 | |
| 1005 | #ifndef IL_NO_BLP |
| 1006 | case IL_BLP: |
| 1007 | bRet = ilLoadBlp(FileName); |
| 1008 | break; |
| 1009 | #endif |
| 1010 | |
| 1011 | #ifndef IL_NO_BMP |
| 1012 | case IL_BMP: |
| 1013 | bRet = ilLoadBmp(FileName); |
| 1014 | break; |
| 1015 | #endif |
| 1016 | |
| 1017 | #ifndef IL_NO_DPX |
nothing calls this directly
no test coverage detected