Exemplo n.º 1
0
ILboolean ilImage::Default()
{
	if (this->Id) {
		this->Bind();
		return ilDefaultImage();
	}
	return IL_FALSE;
}
Exemplo n.º 2
0
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"];
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
// 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;
}
Exemplo n.º 5
0
	Texture::Texture() {
		ilGenImages(1, &image);
		ilBindImage(image);
		ilDefaultImage();
	}
Exemplo n.º 6
0
void ilFDefaultImage_(int *RetVal)
{
	*RetVal = ilDefaultImage();
	return;
}