Skip to content

Conversation

Starbuck5
Copy link
Member

There are a lot of functions that used to return 0 on success, negative error code on failure that in SDL3 return true on success and false on failure. This means our old code compiles but fails at runtime. This PR ports a few of them.

This PR introduces little PG_ compat macros for SDL_SetPaletteColors, SDL_SetSurfaceBlendMode, SDL_GetSurfaceBlendMode, SDL_GetSurfaceAlphaMod, SDL_SetSurfaceAlphaMod.

I only replaced instances of these functions that are actually error checked, I didn't replace them globally. I also fixed a typo in an error message in surf_set_palette.

@Starbuck5 Starbuck5 requested a review from a team as a code owner May 22, 2025 07:16
@Starbuck5 Starbuck5 added Surface pygame.Surface sdl3 labels May 22, 2025
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 thanks for the PR 🎉

Copy link
Member

@MightyJosip MightyJosip left a comment

Choose a reason for hiding this comment

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

LGTM, you defined all the modified functions, and change conditions the right way with the SDL3 (from == 0 to != 0, and other alternatives)

👍

@damusss damusss added this to the 2.5.5 milestone May 31, 2025
@damusss damusss merged commit ac09c5b into pygame-community:main May 31, 2025
27 checks passed
@Starbuck5 Starbuck5 deleted the port-a-few-functions-sdl3 branch May 31, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdl3 Surface pygame.Surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants