ImageActor would add a new texture to the vector of textures in the material
every time a new image was setted instead of updating the image handle of the
texture
Change-Id: I20aca8145521a8dbcdf509b0be169924ffe5d596
SamplerPtr sampler = Sampler::New();
sampler->SetFilterMode( mMinFilter, mMagFilter );
- mTextureIndex = mRenderer->GetMaterial()->AddTexture( image, "sTexture", sampler );
+ if( mTextureIndex != INVALID_TEXTURE_ID )
+ {
+ mRenderer->GetMaterial()->SetTextureImage( mTextureIndex, image.Get() );
+ }
+ else
+ {
+ mTextureIndex = mRenderer->GetMaterial()->AddTexture( image, "sTexture", sampler );
+ }
if( mRendererIndex == INVALID_RENDERER_ID )
{