-
Notifications
You must be signed in to change notification settings - Fork 42
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
SDL.pumpEvents seems to be required in mainLoop for Windows 10 #66
Comments
Hi! This is interesting. I'm also leaning on this being an issue with SDL2, or maybe the bindings. I noticed a new version of the Haskell package was released about a week ago. If you are not using the old Stack LTS (i.e., using Cabal), maybe it's worth trying to fix the I took a quick look, and switching to a previous version of the SDL2 binary with My Windows box is currently in a bad state; I'll take a look as soon as I get it back to working properly. |
It seems you can manually download a specific version of a library from here and install it with: stack exec -- pacman -U mingw-w64-x86_64-SDL2-2.0.14-2-any.pkg.tar.zst Removing the current version can be done with: stack exec -- pacman -R mingw-w64-x86_64-SDL2 |
I upgraded to SDL2 2.0.20, released eight days ago, and I'm having the same issue on macOS. I think it's related to this PR, where it's also discussed that calling SDL_PollEvent in a loop is not a good idea (which is what I'll take a look to see the recommended way of polling events and implement it. Thanks for reporting! |
I went ahead and followed your proposed solution. I looked into implementing the idea suggested here, but I'm not sure it's worth it. If the need arises in the future, it can be reviewed. This is already merged to main. Thanks for the diagnostic and the solution! |
I'll close this issue, since the fix has already been merged to main. It will be included in the 1.3 release (to be released soon). Thanks! |
I can't say exactly what changed on my system to cause this, but my monomer projects suddenly started hanging immediately after launch. Even reverting to older commits which I know worked or cloning monomer and building the example projects had the same behavior.
I did a bit of digging and realized that SDL.pollEvents wasn't returning anything after the first frame.
The fix ended up being a call to SDL.pumpEvents before starting the new frame in Monomer.Main.Core.mainLoop
I'm hesitant to make a PR given that I'm not sure what exactly changed to cause this, but it is consistently reproducible.
One thought I had was the SDL2 version which is
mingw-w64-x86_64-SDL2 2.0.20-1
, but I'm at a bit of a loss otherwise.The text was updated successfully, but these errors were encountered: