From 6d89a7bc7106669be685f8353eb92919408321f3 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Tue, 29 Jan 2019 12:19:32 +0000 Subject: [PATCH] Emscripten: remove GLES_DeleteContext implementation It was calling glClear without a context. The issue it was trying to solve was actually that after destroying a window and creating a new one , the contents of the old window were preserved. This no longer happens since we resize the window to nothing on destroy. --- src/video/emscripten/SDL_emscriptenopengles.c | 13 ------------- src/video/emscripten/SDL_emscriptenopengles.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index d98d099b7128d..e07e8a494853a 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -81,19 +81,6 @@ Emscripten_GLES_LoadLibrary(_THIS, const char *path) { return 0; } -void -Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) -{ - /* - WebGL contexts can't actually be deleted, so we need to reset it. - ES2 renderer resets state on init anyway, clearing the canvas should be enough - */ - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - - SDL_EGL_DeleteContext(_this, context); -} - SDL_EGL_CreateContext_impl(Emscripten) SDL_EGL_SwapWindow_impl(Emscripten) SDL_EGL_MakeCurrent_impl(Emscripten) diff --git a/src/video/emscripten/SDL_emscriptenopengles.h b/src/video/emscripten/SDL_emscriptenopengles.h index c025aedb2b133..154bafaf6eb1d 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.h +++ b/src/video/emscripten/SDL_emscriptenopengles.h @@ -34,9 +34,9 @@ #define Emscripten_GLES_UnloadLibrary SDL_EGL_UnloadLibrary #define Emscripten_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define Emscripten_GLES_GetSwapInterval SDL_EGL_GetSwapInterval +#define Emscripten_GLES_DeleteContext SDL_EGL_DeleteContext extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path); -extern void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context); extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window * window); extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window); extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);