If you try to call SDL_CreateTextureFromSurface() on a 24-bit surface, it creates a 32-bit texture, then calls SDL_UpdateTexture on the surface’s Pixels field without any conversion, leading to a badly distorted result. This can be worked around, but it’s awkward due to the lack of an external API call to create a SDL_PixelFormat independently of a surface.
If you try to call SDL_CreateTextureFromSurface() on a 24-bit surface, it
creates a 32-bit texture, then calls SDL_UpdateTexture on the surface’s
Pixels field without any conversion, leading to a badly distorted result.
No. I’ve got a working patch, but when you consider the number of patches I’ve
already submitted which are just sitting around in the Bugzilla DB gathering dust,
some several months old, that creates a bit of a disincentive to submit any
more…
2009/7/26 Mason Wheeler <@Mason_Wheeler>:
If you try to call SDL_CreateTextureFromSurface() on a 24-bit surface, it
creates a 32-bit texture, then calls SDL_UpdateTexture on the surface’s
Pixels field without any conversion, leading to a badly distorted result.
Have you submitted a bug report?From: llubnek@gmail.com (Kenneth Bull)
Subject: Re: [SDL] SDL_CreateTextureFromSurface() mangles 24-bit surfaces
This should be fixed in the latest SDL 1.3 snapshot.On Sun, Jul 26, 2009 at 7:07 PM, Mason Wheeler wrote:
If you try to call SDL_CreateTextureFromSurface() on a 24-bit surface, it
creates a 32-bit texture, then calls SDL_UpdateTexture on the surface’s
Pixels field without any conversion, leading to a badly distorted result.
This can be worked around, but it’s awkward due to the lack of an external
API call to create a SDL_PixelFormat independently of a surface.