Emscripten: remove GLES_DeleteContext implementation
authorCharlie Birks <charlie@daftgames.net>
Tue, 29 Jan 2019 12:19:32 +0000
changeset 125798dc4e45fbe2b
parent 12578 b127ca09e7fe
child 12580 e5c1992fcd8b
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
src/video/emscripten/SDL_emscriptenopengles.h
     1.1 --- a/src/video/emscripten/SDL_emscriptenopengles.c	Tue Jan 29 12:19:23 2019 +0000
     1.2 +++ b/src/video/emscripten/SDL_emscriptenopengles.c	Tue Jan 29 12:19:32 2019 +0000
     1.3 @@ -81,19 +81,6 @@
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -void
     1.8 -Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context)
     1.9 -{
    1.10 -    /*
    1.11 -    WebGL contexts can't actually be deleted, so we need to reset it.
    1.12 -    ES2 renderer resets state on init anyway, clearing the canvas should be enough
    1.13 -    */
    1.14 -
    1.15 -    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    1.16 -
    1.17 -    SDL_EGL_DeleteContext(_this, context);
    1.18 -}
    1.19 -
    1.20  SDL_EGL_CreateContext_impl(Emscripten)
    1.21  SDL_EGL_SwapWindow_impl(Emscripten)
    1.22  SDL_EGL_MakeCurrent_impl(Emscripten)
     2.1 --- a/src/video/emscripten/SDL_emscriptenopengles.h	Tue Jan 29 12:19:23 2019 +0000
     2.2 +++ b/src/video/emscripten/SDL_emscriptenopengles.h	Tue Jan 29 12:19:32 2019 +0000
     2.3 @@ -34,9 +34,9 @@
     2.4  #define Emscripten_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
     2.5  #define Emscripten_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
     2.6  #define Emscripten_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
     2.7 +#define Emscripten_GLES_DeleteContext SDL_EGL_DeleteContext
     2.8  
     2.9  extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path);
    2.10 -extern void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context);
    2.11  extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window * window);
    2.12  extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window);
    2.13  extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);