Fixed renderer variable scope.
authorSam Lantinga <slouken@libsdl.org>
Sun, 13 Feb 2011 14:05:33 -0800
changeset 5291 39208c821449
parent 5290 25af68c1901d
child 5292 22335352d750
Fixed renderer variable scope.
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Sun Feb 13 14:02:37 2011 -0800
+++ b/src/video/SDL_video.c	Sun Feb 13 14:05:33 2011 -0800
@@ -208,12 +208,12 @@
 SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
 {
     SDL_WindowTextureData *data;
-    SDL_Renderer *renderer = NULL;
     SDL_RendererInfo info;
     Uint32 i;
 
     data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
     if (!data) {
+        SDL_Renderer *renderer = NULL;
         SDL_RendererInfo info;
         int i;
         const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
@@ -267,7 +267,7 @@
         data->pixels = NULL;
     }
 
-    if (SDL_GetRendererInfo(renderer, &info) < 0) {
+    if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
         return -1;
     }
 
@@ -281,7 +281,7 @@
         }
     }
 
-    data->texture = SDL_CreateTexture(renderer, *format,
+    data->texture = SDL_CreateTexture(data->renderer, *format,
                                       SDL_TEXTUREACCESS_STREAMING,
                                       window->w, window->h);
     if (!data->texture) {