ILboolean ilImage::Default() { if (this->Id) { this->Bind(); return ilDefaultImage(); } return IL_FALSE; }
HBITMAP TextureControl::GetBlankBitmap(HDC destDC) { if(namedBitmaps.find("Blank") != namedBitmaps.end()) return namedBitmaps["Blank"]; ILuint img = getImageHandle(); ilDefaultImage(); iluImageParameter(ILU_FILTER, ILU_BILINEAR); iluScale(126,126,1); namedBitmaps["Blank"] = ilutConvertToHBitmap(destDC); ilDeleteImage(img); return namedBitmaps["Blank"]; }
Texture* TextureManager::realLoadAsset(const char* filename) { unsigned int imgid = 0; ILubyte* data = NULL; int width, height, bpp, mml; ilGenImages(1, &imgid); ilBindImage(imgid); if (ilLoadImage(filename) != IL_TRUE) { std::cerr << "Loading Image: '" << filename << "' failed. Generating default." << std::endl; ilDefaultImage(); /*ilDeleteImages(1,&imgid); return NULL;*/ } width = ilGetInteger(IL_IMAGE_WIDTH); height = ilGetInteger(IL_IMAGE_HEIGHT); bpp = ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL); mml = 1; //mml = ilGetInteger(IL_NUM_MIPMAPS); if (bpp == 3) { if (ilConvertImage(IL_RGB, IL_UNSIGNED_BYTE) != IL_TRUE) { ilDeleteImages(1, &imgid); return NULL; } } else if (bpp == 4) { if (ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE) != IL_TRUE) { ilDeleteImages(1, &imgid); return NULL; } } else { ilDeleteImages(1, &imgid); return NULL; } data = ilGetData(); Texture* tex = m_ctx->createTexture(); tex->init(width, height, bpp, mml); tex->uploadData(data, 0, 0, width, height); ilDeleteImages(1, &imgid); return tex; }
// Initializes the image stack's first entry (default image) -- ONLY CALL ONCE! ILvoid iSetImage0() { if (ImageStack == NULL) if (!iEnlargeStack()) return; LastUsed = 1; CurName = 0; ParentImage = IL_TRUE; if (!ImageStack[0]) ImageStack[0] = ilNewImage(1, 1, 1, 1, 1); iCurImage = ImageStack[0]; ilDefaultImage(); return; }
Texture::Texture() { ilGenImages(1, &image); ilBindImage(image); ilDefaultImage(); }
void ilFDefaultImage_(int *RetVal) { *RetVal = ilDefaultImage(); return; }