Preventing execution pause when dragging game window

浪子不回头ぞ 提交于 2019-12-13 14:26:24

问题


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.



来源:https://stackoverflow.com/questions/15299885/preventing-execution-pause-when-dragging-game-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!