I'm new in OpenGL world and I have question about performance and technique:
i have read followed post about performance,
seems like yo use the same texture multiple times leads to better performance.
Got it.
How can I do that in openGL?
[option 1]
use Sprite sheet let's say 3x3 like:
in this case i need cut off or shift it and show one after one, in canvas.drawBitmap
i can use Rect
public void update() {
currentFrame = ++currentFrame % 3;
}
...
int srcX = currentFrame * width;
Rect src = new Rect(srcX, 0, srcX+width, height);
Rect dst = new Rect(x, y, x+width, y+height);
canvas.drawBitmap(b, src, dst, null);
..
[option 2]
Use 9 images and add all of them like:
for(int loop = 0; loop < 9; loop++){
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[loop]);
....
}
2番目のオプションは機能しますが、1番目のオプションが必要です。
助けてください、
ありがとうございました、