防止拖动游戏窗口时执行暂停 [英] Preventing execution pause when dragging game window
问题描述
我有一个服务器和一个客户端。但是,无论何时我开始移动游戏窗口,它都会停止执行代码,直到窗口停止移动为止,这导致连接超时,因为服务器或客户端停止响应了一段时间。
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?
推荐答案
这是XNA游戏的一个已知问题,有几种解决方法。
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.
其他方法可能涉及使用Windows钩子,不幸的是我可以说。我个人建议使用假窗口方法。
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.
这篇关于防止拖动游戏窗口时执行暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!