Question

i have a 1024 x 1024 image I use for a texture in my game for the background.

Im wondering if their is a proper way to handle drawing a large background texture.

How I am doing it currently:

texCoord { 0,0,1,0,0,1,1,1 }
vertice { 0,0,0,height,width,0,width,height }
texCoordPointer(texCoord)
vertexPointer(vertice)

bind the texture
enable client (texCoordArr, vertexCoordArr)
drawArray
disable client (texCoordArr, vertexCoordArr)
Was it helpful?

Solution

That's fine...

I don't know if the GL|ES on the iPhone supports the glDrawTexOES extension, but if it does you may safe some lines of code. It won't make drawing any faster though.

Also some additional hints:

  • try to make the texture exactly as large as the screen. There is no need to store the image in 1024*1024 if the real resolution is more around 480*320. If you zoom or pan the image it's another thing of course.

  • You may save quite a bit of memory if you don't upload mipmaps for the backdrop.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top