检查应用程序何时进入全屏。 (DXGI/DirectX10)
这是我的问题... 有一种方法可以检查应用程序何时在 DXGI (DX10/11) 中全屏显示。 对于全屏,我的意思是系统已完成模式更改。 因为我的应用程序需要它来防止死锁并调整时间。 (我有一个多线程引擎,并且 Present 不在消息泵线程上,导致随机模式更改死锁)) 实际上,我让它等待 1 秒,继续处理消息泵线程上的消息并且它可以工作,但我想要更确定的东西,对我说“嘿,模式更改已完成,您现在处于全屏模式”。 :D
有什么想法吗?
this is my question...
There is a way to check when the application has gone fullscreen in DXGI (DX10/11).
For going Fullscreen I mean that the system has COMPLETED the mode change.
Cause i need it for my application to prevent deadlock and to adjust timing. (I have a multithreaded engine and the Present is not on the message pump thread causing deadlock on mode-change randomly))
Actually I make it wait 1 second continuing to process messages on the message pump thread and it work, but i want something more DETERMINISTIC that says to me "hey, the mode change is complete, you are now in fullscreen mode". :D
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否有任何原因无法将渲染线程和消息泵线程作为同一线程运行?
根据文档,没有任何信息可以告诉您更改已完成。
但奇怪的是,DXGI 依赖于从内部 SendMessage 调用(通过多线程环境中的消息泵发生)获取响应。所以我不明白延迟消息泵如何解决问题。它所做的只是让 DXGI 在继续做它的事情之前多等待一秒钟。死锁通常意味着您正在执行的操作会导致消息泵阻塞,等待渲染线程执行操作。
Is there any reason you can't run the rendering and message pump threads as the same thread?
According to the docs there is nothing that tells you the change is complete.
Strangely, though, DXGI relies on getting responses back from internal SendMessage calls (which occur via the message pump in a multi-threaded environment). So I don't see how delaying your message pump fixes problems. All it will do is make DXGI wait an extra second before continuing to do its stuff. A dead-lock usually implies that you are doing something that causes the message pump to block waiting for the rendering thread to do something.