diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-11-24 03:53:46 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-11-24 03:53:46 +0000 |
commit | d2c64e0b83b37c551c774191f1cd97891d24ac7d (patch) | |
tree | b0cbce5dfe79e342a47030305e83a01740a59529 /src/egl | |
parent | b1abf1ea8e4cad0f574b059149cb9761f12c4053 (diff) |
report error token in message printed in _eglError()
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/main/eglglobals.c | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c index 2b55132dc4..a1b10c7a12 100644 --- a/src/egl/main/eglglobals.c +++ b/src/egl/main/eglglobals.c @@ -44,10 +44,59 @@ _eglDestroyGlobals(void) void _eglError(EGLint errCode, const char *msg) { + const char *s; + if (_eglGlobal.LastError == EGL_SUCCESS) { _eglGlobal.LastError = errCode; + + switch (errCode) { + case EGL_BAD_ACCESS: + s = "EGL_BAD_ACCESS"; + break; + case EGL_BAD_ALLOC: + s = "EGL_BAD_ALLOC"; + break; + case EGL_BAD_ATTRIBUTE: + s = "EGL_BAD_ATTRIBUTE"; + break; + case EGL_BAD_CONFIG: + s = "EGL_BAD_CONFIG"; + break; + case EGL_BAD_CONTEXT: + s = "EGL_BAD_CONTEXT"; + break; + case EGL_BAD_CURRENT_SURFACE: + s = "EGL_BAD_CURRENT_SURFACE"; + break; + case EGL_BAD_DISPLAY: + s = "EGL_BAD_DISPLAY"; + break; + case EGL_BAD_MATCH: + s = "EGL_BAD_MATCH"; + break; + case EGL_BAD_NATIVE_PIXMAP: + s = "EGL_BAD_NATIVE_PIXMAP"; + break; + case EGL_BAD_NATIVE_WINDOW: + s = "EGL_BAD_NATIVE_WINDOW"; + break; + case EGL_BAD_PARAMETER: + s = "EGL_BAD_PARAMETER"; + break; + case EGL_BAD_SURFACE: + s = "EGL_BAD_SURFACE"; + break; + case EGL_BAD_SCREEN_MESA: + s = "EGL_BAD_SCREEN_MESA"; + break; + case EGL_BAD_MODE_MESA: + s = "EGL_BAD_MODE_MESA"; + break; + default: + s = "other"; + } /* XXX temporary */ - fprintf(stderr, "EGL user error 0x%x in %s\n", errCode, msg); + fprintf(stderr, "EGL user error 0x%x (%s) in %s\n", errCode, s, msg); } } |