Open TTimo opened 6 months ago
For a bit more context, this is the initial in-situ investigation of this problem. I only found the workaround later on when writing a test case: https://gitlab.steamos.cloud/devkit/steamos-devkit/-/commit/7e89557f692b7a1437ebbf4f51464a95d4f8f52f#f42379bd6d31600aba6eff88f0c3311df57ccea9
What doesn't work?
I'm finding that
SDL_CreateRGBSurfaceWithFormatFrom
either throws or fails to take in the pixel data (but creates a valid empty SDL_Surface) when passed in a sub-array of abytes
object directly. But it works if I setup an intermediate python object first.How To Reproduce
This test case stems from difficulties I ran into when adding support for setting the application's window icon:
On Windows with Python 3.12 the first
SDL_CreateRGBSurfaceWithFormatFrom
call works. Elsewhere it'll either ignore the pixels and yield a transparent/empty surface, or throw an OSErrror.The workaround is what bugs me the most .. just ..
pixels2 = pixels[4:4+w*h*4]
and all platforms work.Platform:
Additional context Add any other context about the problem here.