mirror of
https://github.com/yawut/SDL.git
synced 2026-08-24 01:35:39 -05:00
If you pass in texture format 0, it'll use the first supported texture format.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user