If you pass in texture format 0, it'll use the first supported texture format.

This commit is contained in:
Sam Lantinga 2011-02-28 14:47:39 -08:00
parent 05b0c40ffa
commit 9b04915913

View file

@ -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;