Fixed renderer variable scope.
authorSam Lantinga <slouken@libsdl.org>
Sun, 13 Feb 2011 14:05:33 -0800
changeset 529139208c821449
parent 5290 25af68c1901d
child 5292 22335352d750
Fixed renderer variable scope.
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sun Feb 13 14:02:37 2011 -0800
     1.2 +++ b/src/video/SDL_video.c	Sun Feb 13 14:05:33 2011 -0800
     1.3 @@ -208,12 +208,12 @@
     1.4  SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
     1.5  {
     1.6      SDL_WindowTextureData *data;
     1.7 -    SDL_Renderer *renderer = NULL;
     1.8      SDL_RendererInfo info;
     1.9      Uint32 i;
    1.10  
    1.11      data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
    1.12      if (!data) {
    1.13 +        SDL_Renderer *renderer = NULL;
    1.14          SDL_RendererInfo info;
    1.15          int i;
    1.16          const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
    1.17 @@ -267,7 +267,7 @@
    1.18          data->pixels = NULL;
    1.19      }
    1.20  
    1.21 -    if (SDL_GetRendererInfo(renderer, &info) < 0) {
    1.22 +    if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
    1.23          return -1;
    1.24      }
    1.25  
    1.26 @@ -281,7 +281,7 @@
    1.27          }
    1.28      }
    1.29  
    1.30 -    data->texture = SDL_CreateTexture(renderer, *format,
    1.31 +    data->texture = SDL_CreateTexture(data->renderer, *format,
    1.32                                        SDL_TEXTUREACCESS_STREAMING,
    1.33                                        window->w, window->h);
    1.34      if (!data->texture) {