src/render/SDL_render.c
changeset 6258 fce7ce72677b
parent 6247 b6212690f78d
child 6260 fd494c5f305b
     1.1 --- a/src/render/SDL_render.c	Sun Jan 22 18:37:46 2012 -0500
     1.2 +++ b/src/render/SDL_render.c	Sun Jan 22 19:22:53 2012 -0500
     1.3 @@ -126,6 +126,26 @@
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +int
     1.8 +SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags,
     1.9 +                            SDL_Window **window, SDL_Renderer **renderer)
    1.10 +{
    1.11 +    *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED,
    1.12 +                                     SDL_WINDOWPOS_UNDEFINED,
    1.13 +                                     width, height, window_flags);
    1.14 +    if (!*window) {
    1.15 +        *renderer = NULL;
    1.16 +        return -1;
    1.17 +    }
    1.18 +
    1.19 +    *renderer = SDL_CreateRenderer(*window, -1, 0);
    1.20 +    if (!*renderer) {
    1.21 +        return -1;
    1.22 +    }
    1.23 +
    1.24 +    return 0;
    1.25 +}
    1.26 +
    1.27  SDL_Renderer *
    1.28  SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
    1.29  {