src/render/SDL_render.c
changeset 6258 fce7ce72677b
parent 6247 b6212690f78d
child 6260 fd494c5f305b
equal deleted inserted replaced
6257:4b6e961362fb 6258:fce7ce72677b
   124         }
   124         }
   125     }
   125     }
   126     return 0;
   126     return 0;
   127 }
   127 }
   128 
   128 
       
   129 int
       
   130 SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags,
       
   131                             SDL_Window **window, SDL_Renderer **renderer)
       
   132 {
       
   133     *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED,
       
   134                                      SDL_WINDOWPOS_UNDEFINED,
       
   135                                      width, height, window_flags);
       
   136     if (!*window) {
       
   137         *renderer = NULL;
       
   138         return -1;
       
   139     }
       
   140 
       
   141     *renderer = SDL_CreateRenderer(*window, -1, 0);
       
   142     if (!*renderer) {
       
   143         return -1;
       
   144     }
       
   145 
       
   146     return 0;
       
   147 }
       
   148 
   129 SDL_Renderer *
   149 SDL_Renderer *
   130 SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
   150 SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
   131 {
   151 {
   132     SDL_Renderer *renderer = NULL;
   152     SDL_Renderer *renderer = NULL;
   133     int n = SDL_GetNumRenderDrivers();
   153     int n = SDL_GetNumRenderDrivers();