Swapping the Buffers#

This function presents the display data to the screen.

When rendering to a window surface, OpenGL ES is usually double or triple buffered. This means that OpenGL ES renders directly to one frame buffer, known as the back buffer, while the display reads from another - the front buffer. eglSwapBuffers signals to the windowing system that OpenGL ES has finished rendering to the back buffer, so it can become the front buffer and be shown on the display. At the same time, the front buffer becomes the back buffer and is made available for OpenGL ES to start rendering to it. Essentially, this call swaps the front and back buffers.

This technique reduces the chance of screen tearing. This is where parts of the old frame and the newly rendered frame are both momentarily visible on the screen.

if (!eglSwapBuffers(_eglDisplay, _eglSurface))
{
    test-egl-error(_surfaceData, "eglSwapBuffers");
    return false;
}
return true;

See also

Internal:

External: