Hack up an inital POC of a blocking eventloop#3390
Draft
learn-more wants to merge 1 commit intoSFML:masterfrom
Draft
Hack up an inital POC of a blocking eventloop#3390learn-more wants to merge 1 commit intoSFML:masterfrom
learn-more wants to merge 1 commit intoSFML:masterfrom
Conversation
Messages are delivered using a callback instead of polled, this allows a window to continue to process events while it is being dragged on Windows
Contributor
|
Callbacks are great, and I agree with this change given that the I wanted to share something interesting though: SDL3 employs callbacks as an optional way to both receive events and enter your program: https://github.com/libsdl-org/SDL/blob/main/docs%2Fhello.c Quite a bit cleaner because it's literally "implementing the interface" but not in an OOP context. It could be an SFML4 prospect to also employ this pattern (although still optional to use) as an entry point into SFML apps. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Messages are delivered using a callback instead of polled, this allows a window to continue to process events while it is being dragged on Windows
Only one example builds, the new main
There is a delay of ~1 sec before the Window is processing events when the left button is clicked on the title bar, I suspect this has to do with the window having the input capture.
devenv_ouiNykNCUi.mp4
The main loop now looks like this: