mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-18 10:48:28 +00:00
Don't set a YCbCr colorspace for an RGB texture
Fixes https://github.com/libsdl-org/SDL/issues/10006
This commit is contained in:
parent
2d13fefc20
commit
876f10795f
1 changed files with 6 additions and 1 deletions
|
@ -1360,7 +1360,12 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
|
|||
closest_format = renderer->texture_formats[0];
|
||||
}
|
||||
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, texture->colorspace);
|
||||
default_colorspace = SDL_GetDefaultColorspaceForFormat(closest_format);
|
||||
if (SDL_COLORSPACETYPE(texture->colorspace) == SDL_COLORSPACETYPE(default_colorspace)) {
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, texture->colorspace);
|
||||
} else {
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, default_colorspace);
|
||||
}
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, closest_format);
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, texture->access);
|
||||
SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, texture->w);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue