ILuint ImageManager::loadImage(char* filepath, bool ColorKey) { ILuint ImageID; ilGenImages(1, &ImageID); ilBindImage(ImageID); char buffer[64]; if (!ilLoadImage(filepath)) { sprintf(buffer, "Failed to load Image file: %s", filepath); Ogre::LogManager::getSingleton().getLog("Khazad.log")->logMessage(buffer); return -1; } else { sprintf(buffer, "Loading Image file: %s", filepath); Ogre::LogManager::getSingleton().getLog("Khazad.log")->logMessage(buffer); } /* IL_RGB IL_RGBA IL_BGR IL_BGRA IL_LUMINANCE IL_COLOUR_INDEX IL_BYTE IL_UNSIGNED_BYTE IL_SHORT IL_UNSIGNED_SHORT IL_INT IL_UNSIGNED_INT IL_FLOAT IL_DOUBLE */ ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE); if(ColorKey) { //convert color key } ReportDevILErrors(); return ImageID; }
ILuint ImageManager::loadImage(char* filepath, bool ColorKey) { ILuint ImageID; ilGenImages(1, &ImageID); ilBindImage(ImageID); printf("Loading Image file: %s\n", filepath); if(!ilLoadImage(filepath)) { cerr << "Couldn't load image " << filepath << endl; } /* IL_RGB IL_RGBA IL_BGR IL_BGRA IL_LUMINANCE IL_COLOUR_INDEX IL_BYTE IL_UNSIGNED_BYTE IL_SHORT IL_UNSIGNED_SHORT IL_INT IL_UNSIGNED_INT IL_FLOAT IL_DOUBLE */ ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE); if(ColorKey) { //convert color key } ReportDevILErrors(); return ImageID; }