blitz-research / monkey

Blitz Research Monkey Source
225 stars 59 forks source link

GLFW3 Window Closing Hotfix (OnClose) #87

Closed ImmutableOctet closed 8 years ago

ImmutableOctet commented 8 years ago

This fixes the bug discussed on the forums, here.

Basically, GLFW3 (And ANGLE) will close a window by default, unless otherwise stopped. With this in mind, if you want to handle when 'EndApp' is called in Mojo, or more commonly, override the 'OnClose' method, the window would be closed without the developer giving the go-ahead. This fixes that behavior, albeit weirdly. This relies on 1-1 event handling for keyboard input, which I'm unsure about the behavior of.

This isn't the cleanest method, but it works for now. If you intend to clean this up more, don't bother merging, and please close this pull request. If you do take this into your own hands, I recommend looking further up the chain.

blitz-research commented 8 years ago

Thanks for that! Fixed this manually myself as I had also deleted a bunch of dead code in those files and I suck at merging...