Hi!
I'm coding a platforms game and when the window the game is running on loses focus, the framerate falls a lot and some of my physics functions stop working --making the game unplayable when focus returns.
So, I'd like to pause the game whenever focus is lost (alt+tab/minimizing window/etc), but I don't know how to detect when focus is lost/obtained.
Any suggestions? Thanks in advance :)
I'm coding a platforms game and when the window the game is running on loses focus, the framerate falls a lot and some of my physics functions stop working --making the game unplayable when focus returns.
So, I'd like to pause the game whenever focus is lost (alt+tab/minimizing window/etc), but I don't know how to detect when focus is lost/obtained.
Any suggestions? Thanks in advance :)