Preventing execution pause when dragging game wind

2019-07-03 02:02发布

问题:

I have a server and a client. But when ever I start moving the game window, it stops executing code until the window stops moving,causing a connection timed out because the server or client stopped responding for a while.

What do I need to do in order to make the game always run code, even when the game window is being moved?

回答1:

This is a known issue with XNA games, and there are several ways around it.

One way is to move a fake window frame, which isn't the game window really. Game window will then fit into the fake window's client area, only pausing execution for insignificant amount of time.

Other ways may involve use of windows hooks, unfortunately, that is all I can say about it. Personally, I recommend the approach with fake window.



标签: xna window drag