GlScissor Help (iPhone OpenGL ES)

I am trying to use glScissor to select only those parts of the screen that need updating. I have a playground where I need to update every frame, but the user interface area needs to be updated much less frequently. The game area is beautiful, but the user interface area constantly flickers with what looks 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];
+3
source share
2 answers

kEAGLDrawablePropertyRetainedBacking CAEAGLLayer? YES, . , : 2 . , . , . ( , , .) , , , , .

, , , , , . . ( . Apple.

GLPaint - , .

+4

:

glEnable(GL_SCISSOR_TEST);

, , , , . .

+1

Source: https://habr.com/ru/post/1705416/


All Articles