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

Improved Window.flip error message when no surface is associated with the Window #2633

Merged

Conversation

Matiiss
Copy link
Member

@Matiiss Matiiss commented Dec 25, 2023

Previously the error message would have been "Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface"

This also adds a video init check, which is related to this issue: #2605
But I don't know if it should stay here, because if, for instance, we implicitly init video on Window creation, this check shouldn't be needed here?

@Matiiss Matiiss requested a review from a team as a code owner December 25, 2023 14:24
@Matiiss Matiiss changed the title Improved Window.flip error message when no surface is associated with it Improved Window.flip error message when no surface is associated with the Window Dec 25, 2023
@Matiiss Matiiss added the window pygame.Window label Dec 25, 2023
src_c/window.c Outdated Show resolved Hide resolved
src_c/window.c Outdated Show resolved Hide resolved
@Matiiss Matiiss force-pushed the matiiss-improve-window-flip-err-msg branch from b738989 to f97d3c0 Compare January 6, 2024 22:01
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 🎉

(yes this is going to conflict with my window.surface PR but I can handle that later if/when the PR gets accepted, so let's get this in first)

@ankith26 ankith26 added this to the 2.5.0 milestone Jan 7, 2024
Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me.

@Starbuck5 Starbuck5 merged commit 04cc697 into pygame-community:main Jan 17, 2024
30 checks passed
Starbuck5 added a commit that referenced this pull request Feb 18, 2024
…-msg

Improved `Window.flip` error message when no surface is associated with the `Window`
@Starbuck5 Starbuck5 modified the milestones: 2.5.0, 2.4.1 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
window pygame.Window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants