so just double buffer texture
GLuint tids[2];
glGenTextures(2, tids);
glBindTexture(GL_TEXTURE_2D, tids[0]);
glTexImage2D(GL_TEXTURE_2D, 0, FinFormat, Width, Height, 0, FinFormat,
ComponentType, NULL); // preallocate GPU ram for first texture
glBindTexture(GL_TEXTURE_2D, tids[1]);
glTexImage2D(GL_TEXTURE_2D, 0, FinFormat, Width, Height, 0, FinFormat,
ComponentType, NULL); // preallocate GPU ram for second texture
int counter = 0;
your game loop:
glBindTexture(GL_TEXTURE_2D, tids[counter]);
glTexSubImage2D(...) // upload portion of texture ... or just the
whole one ... BUT ALWAYS USE glTexSubImage2D even if you uploading
whole texture - this way driver will not reallocate it all over again
DrawQuad(tids[counter]);
counter = (counter+1)&1;
this way you will allow gpu to be lagging one frame behind cpu before
the cpu will be forced to wait for gpu - hope that helps
>> >
android-ndk...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/android-ndk/-/AldDq8TG0oMJ.
>
android-ndk...@googlegroups.com.