Improved error message for unsupported texture format
This commit is contained in:
parent
0fa1d9fe61
commit
d6dc10e868
2 changed files with 4 additions and 2 deletions
|
@ -760,7 +760,8 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
|
|
||||||
if (!convert_format(renderdata, texture->format, &internalFormat,
|
if (!convert_format(renderdata, texture->format, &internalFormat,
|
||||||
&format, &type)) {
|
&format, &type)) {
|
||||||
SDL_SetError("Unsupported texture format");
|
SDL_SetError("Texture format %s not supported by OpenGL",
|
||||||
|
SDL_GetPixelFormatName(texture->format));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (texture->format == SDL_PIXELFORMAT_UYVY &&
|
if (texture->format == SDL_PIXELFORMAT_UYVY &&
|
||||||
|
|
|
@ -408,7 +408,8 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
type = GL_UNSIGNED_SHORT_4_4_4_4;
|
type = GL_UNSIGNED_SHORT_4_4_4_4;
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue