Improved error message for unsupported texture format
authorSam Lantinga <slouken@libsdl.org>
Wed, 12 Jan 2011 19:33:04 -0800
changeset 4990 397e748d901a
parent 4989 58b6bb4a45e9
child 4991 dc9924fc5070
Improved error message for unsupported texture format
src/video/SDL_renderer_gl.c
src/video/SDL_renderer_gles.c
--- a/src/video/SDL_renderer_gl.c	Wed Jan 12 17:53:06 2011 -0800
+++ b/src/video/SDL_renderer_gl.c	Wed Jan 12 19:33:04 2011 -0800
@@ -760,7 +760,8 @@
 
     if (!convert_format(renderdata, texture->format, &internalFormat,
                         &format, &type)) {
-        SDL_SetError("Unsupported texture format");
+        SDL_SetError("Texture format %s not supported by OpenGL",
+                     SDL_GetPixelFormatName(texture->format));
         return -1;
     }
     if (texture->format == SDL_PIXELFORMAT_UYVY &&
--- a/src/video/SDL_renderer_gles.c	Wed Jan 12 17:53:06 2011 -0800
+++ b/src/video/SDL_renderer_gles.c	Wed Jan 12 19:33:04 2011 -0800
@@ -408,7 +408,8 @@
         type = GL_UNSIGNED_SHORT_4_4_4_4;
         break;
     default:
-        SDL_SetError("Unsupported by OpenGL ES texture format");
+        SDL_SetError("Texture format %s not supported by OpenGL ES",
+                     SDL_GetPixelFormatName(texture->format));
         return -1;
     }