src/video/SDL_video.c
changeset 1923 d4572b97b08f
parent 1920 8a162bfdc838
child 1924 69217fdd2c0a
--- 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;
 }