diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index e10cf7c70..c9fb476b0 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -909,8 +909,7 @@ SDL_EGL_ChooseConfig(_THIS) int ret; if (!_this->egl_data) { - /* The EGL library wasn't loaded, SDL_GetError() should have info */ - return -1; + return SDL_SetError("EGL not initialized"); } /* Try with EGL_CONFIG_CAVEAT set to EGL_NONE, to avoid any EGL_SLOW_CONFIG or EGL_NON_CONFORMANT_CONFIG */ @@ -943,7 +942,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) SDL_bool profile_es = (profile_mask == SDL_GL_CONTEXT_PROFILE_ES); if (!_this->egl_data) { - /* The EGL library wasn't loaded, SDL_GetError() should have info */ + SDL_SetError("EGL not initialized"); return NULL; } @@ -1044,16 +1043,8 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) _this->egl_data->egl_swapinterval = 0; if (SDL_EGL_MakeCurrent(_this, egl_surface, egl_context) < 0) { - /* Save the SDL error set by SDL_EGL_MakeCurrent */ - char errorText[1024]; - SDL_strlcpy(errorText, SDL_GetError(), SDL_arraysize(errorText)); - - /* Delete the context, which may alter the value returned by SDL_GetError() */ + /* Delete the context */ SDL_EGL_DeleteContext(_this, egl_context); - - /* Restore the SDL error */ - SDL_SetError("%s", errorText); - return NULL; } @@ -1096,7 +1087,7 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) EGLContext egl_context = (EGLContext) context; if (!_this->egl_data) { - return SDL_SetError("OpenGL not initialized"); + return SDL_SetError("EGL not initialized"); } if (!_this->egl_data->eglMakeCurrent) { @@ -1104,7 +1095,7 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) /* Can't do the nothing there is to do? Probably trying to cleanup a failed startup, just return. */ return 0; } else { - return SDL_SetError("OpenGL not initialized"); /* something clearly went wrong somewhere. */ + return SDL_SetError("EGL not initialized"); /* something clearly went wrong somewhere. */ } } diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 5b917dbb4..6ed5918e7 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -670,9 +670,8 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) * be passed into eglCreateWindowSurface. */ if (SDL_EGL_ChooseConfig(_this) != 0) { - char buf[512]; - SDL_snprintf(buf, sizeof(buf), "SDL_EGL_ChooseConfig failed: %s", SDL_GetError()); - return SDL_SetError("%s", buf); + /* SDL_EGL_ChooseConfig failed, SDL_GetError() should have info */ + return -1; } if (video_data->winrtEglWindow) { /* ... is the 'old' version of ANGLE/WinRT being used? */