I am trying to understand below code from andengine to load the texture, i would like to know what is 512 n 512(i know its height and width), but the image of size 480 * 320.
public void onLoadResources() {
this.mTexture = new Texture(512, 512,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mSplashTextureRegion = TextureRegionFactory
.createFromAsset(this.mTexture,this, "image.png", 0, 0);
this.mEngine.getTextureManager().loadTexture(this.mTexture);
}
I searched on the net but no expected explanation.
I don’t know well AndEngine but this might be because a lot of libs assume that images dimension are power of two.
Here you can find a better explanation:
About power of 2 rule.