src/render/SDL_render.c
changeset 7770 28031e0042b2
parent 7761 bddbfca922cd
child 7898 72af77fc6683
child 8535 e8ee0708ef5c
equal deleted inserted replaced
7769:cf8dd3177612 7770:28031e0042b2
   408     }
   408     }
   409     if (w <= 0 || h <= 0) {
   409     if (w <= 0 || h <= 0) {
   410         SDL_SetError("Texture dimensions can't be 0");
   410         SDL_SetError("Texture dimensions can't be 0");
   411         return NULL;
   411         return NULL;
   412     }
   412     }
       
   413     if ((renderer->info.max_texture_width && w > renderer->info.max_texture_width) ||
       
   414         (renderer->info.max_texture_height && h > renderer->info.max_texture_height)) {
       
   415         SDL_SetError("Texture dimensions are limited to %dx%d", renderer->info.max_texture_width, renderer->info.max_texture_height);
       
   416         return NULL;
       
   417     }
   413     texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
   418     texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
   414     if (!texture) {
   419     if (!texture) {
   415         SDL_OutOfMemory();
   420         SDL_OutOfMemory();
   416         return NULL;
   421         return NULL;
   417     }
   422     }