Skip to content

Process event when needed #417

Answered by mikke89
xland asked this question in Q&A
Feb 20, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Yeah, I would suggest that you try it out and see how it goes. You can simply test it by modifying the SFML backend, it would just be a matter of swapping out the pollEvent with waitEvent here:

while (data->window.pollEvent(ev))

You could implement the same functionality in any of the other backends too. That will be platform specific, so you will have to look up how to do it for your platform (or see how SFML implements it).

Now, this clearly wouldn't work for example if you have animations playing. Then you would have to run the loop regardless of events. There could be other situations like this, like when …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@xland
Comment options

@mikke89
Comment options

@xland
Comment options

Answer selected by xland
Comment options

You must be logged in to vote
1 reply
@xland
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants