Testing for EGL Errors#

eglGetError returns the last error that occurred using EGL, not necessarily the status of the last called function. Check after every single EGL call or at least once every frame. Usually this would be for debugging only, but for this example it is always enabled.

EGLint lastError = eglGetError();
if (lastError != EGL_SUCCESS)
{
    Log(true, "%s failed (%x).\n", functionLastCalled, lastError);
    return false;
}

return true;

See also

External: