Skip to content

A few surface.c SDL3 fixes #3344

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

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

Starbuck5
Copy link
Member

This PR is more low hanging fruit towards porting surface.c to SDL3.

The remaining complex things in this file are

  • surface.init
  • surface.convert
  • RLEACCEL changes

I have patches staged that get those items to compile as well, but they are more complex or provisional (in the case of RLEACCEL). So I will open them in future PRs.

@Starbuck5 Starbuck5 added Surface pygame.Surface sdl3 labels Feb 22, 2025
@Starbuck5 Starbuck5 requested a review from a team as a code owner February 22, 2025 10:22
@Starbuck5 Starbuck5 marked this pull request as draft February 22, 2025 10:22
@Starbuck5 Starbuck5 marked this pull request as ready for review February 22, 2025 10:56
if (!PG_GetSurfaceClipRect(surf, &clip_rect)) {
return RAISE(pgExc_SDLError, SDL_GetError());
}

SDL_Rect surf_rect = {0, 0, surf->w, surf->h};

// In SDL3, SDL_IntersectRect is renamed to SDL_GetRectIntersection
Copy link
Member

Choose a reason for hiding this comment

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

Following this comment, should branching be made to use the correct name? should a macro be made? There are roughly 6 usages of this function in the codebase, in pygame._sdl2 aswell.
I guess you didn't change it here because it is out of scope from surface-only related fixes, do you plan on fixing it in another PR?

Copy link
Member

Choose a reason for hiding this comment

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

It's probably covered by SDL_ENABLE_OLD_NAMES already.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is covered by old names, yes.

Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

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

Looking good, and my comment is just for info. Thanks :)

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 🥳

@ankith26 ankith26 added this to the 2.5.4 milestone Feb 22, 2025
@ankith26 ankith26 merged commit 5728de9 into pygame-community:main Feb 22, 2025
25 checks passed
@Starbuck5 Starbuck5 deleted the surface-sdl3-a-bit-more branch February 22, 2025 21:46
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.

3 participants