views:

68

answers:

1

Bad news everyone!

I'm trying to port old Windows game to iPad and I have a problem. Much of all graphics written without hardware acceleration. On Windows it uses LockRect() call from IDirect3DSurface8 class to get colorbuffer from backbuffer and write some graphics data. After this it uses UnlockRect to send our pixel color data to videomemory. But OpenGL ES hasn't such functionality. I'm trying to emulate this. I have an array which I draw every game tact using glTexImage2D() then glDrawTexfOES(0, 0, 0, 1024, 768)

But creating a texture from array every tact is too slow. How can I do this much faster? Thanks in advance.

+1  A: 

Try a rendering a textured quad and use glTexSubImage2D() for texture re-uploads.

genpfault
Yes, glTexSubImage2D just replaces the data, while using glTexImage2D reallocates the data. It should be faster.
Matias Valdenegro