Skip to content

Commit

Permalink
SDL_CreateWindowTexture() shouldn't use 10-bit or float textures
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 26, 2024
1 parent 696ecca commit 35785d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/video/SDL_video.c
Expand Up @@ -314,9 +314,12 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
*format = info.texture_formats[0];

for (i = 0; i < info.num_texture_formats; ++i) {
if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) &&
transparent == SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) {
*format = info.texture_formats[i];
SDL_PixelFormatEnum texture_format = info.texture_formats[i];
if (!SDL_ISPIXELFORMAT_FOURCC(texture_format) &&
!SDL_ISPIXELFORMAT_10BIT(texture_format) &&
!SDL_ISPIXELFORMAT_FLOAT(texture_format) &&
transparent == SDL_ISPIXELFORMAT_ALPHA(texture_format)) {
*format = texture_format;
break;
}
}
Expand Down

0 comments on commit 35785d1

Please sign in to comment.