If you pass in texture format 0, it'll use the first supported texture format.
This commit is contained in:
parent
05b0c40ffa
commit
9b04915913
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue