Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
If you pass in texture format 0, it'll use the first supported textur…
Browse files Browse the repository at this point in the history
…e format.
  • Loading branch information
slouken committed Feb 28, 2011
1 parent dd7cf0c commit e07b1b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/render/SDL_render.c
Expand Up @@ -260,6 +260,9 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int

CHECK_RENDERER_MAGIC(renderer, NULL);

if (!format) {
format = renderer->info.texture_formats[0];
}
if (SDL_ISPIXELFORMAT_INDEXED(format)) {
SDL_SetError("Palettized textures are not supported");
return NULL;
Expand Down

0 comments on commit e07b1b1

Please sign in to comment.