Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for rwobject (now iostream) SDL3 #2933

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

Starbuck5
Copy link
Member

@Starbuck5 Starbuck5 commented Jun 17, 2024

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 Starbuck5 requested a review from a team as a code owner June 17, 2024 06:27
@Starbuck5 Starbuck5 marked this pull request as draft June 17, 2024 06:27
@Starbuck5 Starbuck5 added rwops SDL's IO loading/streaming code sdl3 labels Jun 17, 2024
@Starbuck5 Starbuck5 marked this pull request as ready for review June 17, 2024 07:02
@Starbuck5
Copy link
Member Author

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

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks good to me 👍

@ankith26
Copy link
Member

This PR was made a while back, has there been any SDL3 changes in the meantime that makes this PR need changes?

@Starbuck5
Copy link
Member Author

This PR was made a while back, has there been any SDL3 changes in the meantime that makes this PR need changes?

To compile: no
to compile without warnings (/ correctly) : yes

I've updated it now and it should be good.

I'm aware the rwobject.c changes probably look scary: all my changes have been for the SDL3 code paths, SDL2 is unaffected by these changes.

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This PR is perfectly SDL2 safe and passes SDL3 CI. Should be good to go now, thanks! 😎

@ankith26 ankith26 added this to the 2.5.2 milestone Oct 6, 2024
@ankith26 ankith26 merged commit f3f112a into pygame-community:main Oct 6, 2024
28 checks passed
@Starbuck5 Starbuck5 deleted the rwobject-fixes-sdl3 branch October 6, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rwops SDL's IO loading/streaming code sdl3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants