Exemplo n.º 1
0
void ImageBox::SetTexture(TexturePtr pTexture)
{
	//mImageFile.clear();
	if (!pTexture || strlen(pTexture->GetFilePath())==0){
		mImageFile.clear();
	}
	mTexture = pTexture;
	SAMPLER_DESC sd;
	sd.AddressU = TEXTURE_ADDRESS_BORDER;
	sd.AddressV = TEXTURE_ADDRESS_BORDER;
	sd.AddressW = TEXTURE_ADDRESS_BORDER;
	mUIObject->GetMaterial()->SetTexture(pTexture, BINDING_SHADER_PS, 0, sd);
	if (pTexture)
		CalcUV(pTexture->GetSize());
}