-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Point SDL2 port at upstream #15452
Merged
Merged
Point SDL2 port at upstream #15452
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f0f8377
Avoid calling SDL_Quit in SDL2 tests
Daft-Freak ebb5d39
Fix sdl_togglefullscreen for new event target behaviour
Daft-Freak adbe679
Remove creating a renderer from test_webgl_context_attributes_sdl2
Daft-Freak 86efa76
Update SDL2 port to point at upstream
Daft-Freak 7ea9bff
changelog
Daft-Freak 587b066
Merge branch 'main' into upstream-sdl
kripken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,8 +136,9 @@ int main() { | |
/* SDL 1 limits which events can be used here. | ||
* Click and mouseup don't work. | ||
*/ | ||
if (emscripten_set_mouseup_callback(NULL, NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { | ||
if (emscripten_set_mouseup_callback("#canvas", NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { | ||
printf("Couldn't to set mouse callback. Test failed.\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
return 1; | ||
} | ||
|
||
printf("You should see a yellow canvas.\n"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove these calls/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise all windows get destroyed and the tests fail because the canvas is gone (well, 0x0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So have these tests been failing forever?
Can we perhaps land all these test fixes separately (first), since they seem independent of the SDL2 update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these were passing with the old version, so something may have changed there. I can split the test fixes out though.
(The testfullscreen one has likely been failing for a while.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did slightly worry that we have a behavioral change here? My understanding is that switching to upstream SDL would essentially be a no-op but this seem to contradict that.
Can you explain a little more what you mean by "tests fail because the canvas is gone (well, 0x0)."? Is this test run as part of CI? i.e. would reverting this part of the change cause CI to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for clarifying. Makes sense. Could you replace these with a comment maybe
// Exiting without calling SDL_Quit so the test framework can the canvas data
(or something like that.. I'm not sure I have the working corret.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, some of the other tests already have something like that:
emscripten/tests/sdl2glshader.c
Line 169 in df034c9
Must have been missed in these ones due to the missing
SDL_Init
and the bug in quit... will updateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also a good idea to add a changlog entry for this? Both in general for the change to use latest upstream, and specifically for this noticeable issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, yeah +4 SDL releases is probably worth a changelog entry! I'll try to come up with something...
(note that the issue here is only noticeable if you don't call
SDL_Init
but do callSDL_Quit
... otherwise it happened a few updates ago)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks! Yeah, I guess the breaking change here is not that important to mention then. But the +4 versions is 😄 Any positive highlights that people might notice could also be worth mentioning briefly in the log.