If you pass in texture format 0, it'll use the first supported texture format.
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Feb 2011 14:47:39 -0800
changeset 5413 64c0e474c459
parent 5412 279f6853c459
child 5414 130cdb16fa93
If you pass in texture format 0, it'll use the first supported texture format.
src/render/SDL_render.c
--- a/src/render/SDL_render.c	Mon Feb 28 09:26:35 2011 -0800
+++ b/src/render/SDL_render.c	Mon Feb 28 14:47:39 2011 -0800
@@ -260,6 +260,9 @@
 
     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;