Mercurial > sdl-ios-xcode
diff src/video/SDL_video.c @ 1923:d4572b97b08f
Switch OpenGL contexts when switching render contexts.
Query the maximum texture size and show the current render parameters.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 22 Jul 2006 19:51:48 +0000 |
parents | 8a162bfdc838 |
children | 69217fdd2c0a |
line wrap: on
line diff
--- a/src/video/SDL_video.c Sat Jul 22 19:03:31 2006 +0000 +++ b/src/video/SDL_video.c Sat Jul 22 19:51:48 2006 +0000 @@ -1366,10 +1366,7 @@ window->renderer = SDL_CurrentDisplay.render_drivers[index].CreateRenderer(window, flags); - if (!window->renderer) { - return -1; - } - SDL_CurrentDisplay.current_renderer = window->renderer; + SDL_SelectRenderer(window->id); return 0; } @@ -1378,11 +1375,18 @@ SDL_SelectRenderer(SDL_WindowID windowID) { SDL_Window *window = SDL_GetWindowFromID(windowID); + SDL_Renderer *renderer; if (!window || !window->renderer) { return -1; } - SDL_CurrentDisplay.current_renderer = window->renderer; + renderer = window->renderer; + if (renderer && renderer->ActivateRenderer) { + if (renderer->ActivateRenderer(renderer) < 0) { + return -1; + } + } + SDL_CurrentDisplay.current_renderer = renderer; return 0; }