From 5c1c6af37d4f4e0c88a5caf9b67afef0a0ffa58a Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Thu, 28 Nov 2013 12:49:35 +0100 Subject: Remove ambiguous error reporting of EGL_NOT_INITIALIZED and add error reporting for EGL_BAD_ACCESS when invalid internal state is encountered. --- src/library_egl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 { -- cgit v1.2.3-18-g5258