I want to allow the user, but that my XNA Game in Windows if it is set to "Game.IsActive == false" to suppress only the "Game.Draw (GameTime)" not the "Game.Update (GameTime)". Is this possible?
I'm aware of any way to control the behavior of IsActive directly. It's in the base Game class, and it's not virtual, so you can't override it.
But it kind of seems like it's more or less doing what you wanted it to do. Here's what I'm seeing:
- When the game has focus and is not minimized, Draw and Update both get called regularly, and IsActive is set to true.
- When the game does not have focus but is still not minimized, Draw and Update both get called regularly (on my computer, the Draw calls seem less frequent, and the frame rate seems to lag a bit, but I'm not sure if that's universal or something unique to my computer). In this case IsActive is set to false, but the methods themselves still get called.
- When the game is minimized and another program has focus, only Update is called regularly, and IsActive is false.
The bottom line is, while I don't think you can alter the behavior of IsActive, in either of those methods, you can put a check at the top of the method and return immediately without doing anything else if the game is not active.
"May the mercy of His Divine Shadow fall upon you." - Stanley H. Tweedle, Security Guard class IV, The League of 20,000 planets