diff options
author | Andreas Bergmeier <abergmeier@gmx.net> | 2013-11-28 12:49:35 +0100 |
---|---|---|
committer | Andreas Bergmeier <abergmeier@gmx.net> | 2014-02-14 15:36:24 +0100 |
commit | 5c1c6af37d4f4e0c88a5caf9b67afef0a0ffa58a (patch) | |
tree | 9b5b1537470624b0d5dca6a4fe3b9b7fbde7b7d5 /src | |
parent | 95f56fca115aa35bf30a240f9faf3534d8035136 (diff) |
Remove ambiguous error reporting of EGL_NOT_INITIALIZED and add error reporting for EGL_BAD_ACCESS when invalid internal state is encountered.
Diffstat (limited to 'src')
-rw-r--r-- | src/library_egl.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library_egl.js b/src/library_egl.js index 1aba9306..551169d1 100644 --- a/src/library_egl.js +++ b/src/library_egl.js @@ -551,8 +551,10 @@ var LibraryEGL = { eglSwapBuffers__deps: ['glFlush', '$GL'], // EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); eglSwapBuffers: function() { - if (!Module.ctx) { + if (!EGL.defaultDisplayInitialized) { EGL.setErrorCode(0x3001 /* EGL_NOT_INITIALIZED */); + } else if (!Module.ctx) { + EGL.setErrorCode(0x3002 /* EGL_BAD_ACCESS */); } else if (Module.ctx.isContextLost()) { EGL.setErrorCode(0x300E /* EGL_CONTEXT_LOST */); } else { |