SDL: Clean up GL context
Jeffrey Pfau jeffrey@endrift.com
Fri, 26 Jun 2015 02:15:05 -0700
4 files changed,
6 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -84,6 +84,7 @@ - ARM7: Add emulation for Undefined CPU mode
- GBA: More accurate cycle estimation for ROM prefetch and flash save chips - ARM7: Reduce the size of the Thumb instruction table - GBA: Don't include GBACLIDebugger struct unless needed + - SDL: Clean up GL context 0.2.1: (2015-05-13) Bugfixes:
M
src/platform/sdl/gl-sdl.c
→
src/platform/sdl/gl-sdl.c
@@ -51,7 +51,7 @@ #endif
#if SDL_VERSION_ATLEAST(2, 0, 0) renderer->window = SDL_CreateWindow(projectName, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->player.fullscreen)); - SDL_GL_CreateContext(renderer->window); + renderer->glCtx = SDL_GL_CreateContext(renderer->window); SDL_GL_SetSwapInterval(1); SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight); renderer->player.window = renderer->window;@@ -109,4 +109,7 @@ if (renderer->gl.d.deinit) {
renderer->gl.d.deinit(&renderer->gl.d); } free(renderer->d.outputBuffer); +#if SDL_VERSION_ATLEAST(2, 0, 0) + SDL_GL_DeleteContext(renderer->glCtx); +#endif }
M
src/platform/sdl/main.c
→
src/platform/sdl/main.c
@@ -176,5 +176,4 @@
renderer->deinit(renderer); SDL_Quit(); - }
M
src/platform/sdl/main.h
→
src/platform/sdl/main.h
@@ -45,6 +45,7 @@ #if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_Window* window; SDL_Texture* sdlTex; SDL_Renderer* sdlRenderer; + SDL_GLContext* glCtx; #endif int viewportWidth;