pygame-community / pygame-ce

🐍🎮 pygame - Community Edition is a FOSS Python library for multimedia applications (like games). Built on top of the excellent SDL library.
https://pyga.me
766 stars 120 forks source link

Fixes for rwobject (now iostream) SDL3 #2933

Open Starbuck5 opened 1 week ago

Starbuck5 commented 1 week ago

In SDL3, the RWops system has been remade into the IOStream system.

So, for SDL itself they have an oldnames compatibility layer that I've enabled at compile time for my SDL3 experimentation. This means our code can still say "SDL_RWops*" and other "RW" things. But they don't have this for the satellite libraries (yet?), so I've gone ahead and implemented explicit preprocessor macros to switch the "RW" load functions to the "IO" load functions.

The system has also changed how custom RWops are created, and the signature of the callbacks, so this patch fixes that to work in both SDL2 and SDL3. It's one of the more complex patches I've submitted for SDL3 support, but the big idea of it is that it doesn't change anything in SDL2, to stay safe.

Starbuck5 commented 1 week ago

1 failing check due to numpy.alltrue being removed in numpy 2.0.