I am trying to use glScissor to isolate only the parts of the screen that need updating. I have a game area where I need to update every frame, but the UI area needs to be updated much less frequently. The game area is fine but the UI area is constantly flickering with what seems like old buffer data.
What am I missing?
Here is my rendering code:
[EAGLContext setCurrentContext:context];
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
if (needsUIUpdate) {
// clear entire screen glScissor(0, 0, 320, 480);
glClear(GL_COLOR_BUFFER_BIT);
needsUIUpdate = NO; [self updateUI]; } else { glScissor(0, 80, 320, 400); glClear(GL_COLOR_BUFFER_BIT); }
for (Cell* c in allCells) [c animate];
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES];