如何防止全屏双缓冲应用程序在调试时冻结屏幕?

发布于 2024-08-21 05:05:04 字数 390 浏览 2 评论 0原文

我正在制作一个使用双缓冲的全屏应用程序。问题如下:当我调试它并且调试器暂停进程(断点命中或抛出异常)时,辅助缓冲区可能会卡在屏幕上。在这种情况下,我只看到当前帧和鼠标指针,我可以与 IDE 的 UI 交互,但我看不到它(因为它是在主缓冲区上绘制的,但不可见,我只能猜测按钮在哪里) 。我认为这种行为取决于图形驱动程序和操作系统,但可能我不是唯一遇到此问题的人(在 Ubuntu 上没有类似的问题,但在 Windows 中)。

有谁知道如何将主缓冲区放在前面?

(ps:如果您有更好的想法,请随时纠正我的拼写错误并提供更好的标题。)

编辑:好的,我知道我可以购买新的显示器或在窗口模式下运行应用程序。但我的问题是关于全屏模式。我忘了提及如果我无法重新启动我的程序并且第二个缓冲区被卡住,摆脱这种情况的唯一方法就是重置。

I'm making a full screen app that uses double buffering. The problem is a following: when I debug it and the debugger pauses the process (breakpoint hit or exception thrown), the secondary buffer may got stuck on the screen. In this case I only see the current frame and the mouse pointer and I can interact with the IDE's UI but I don't see it (because it is drawn on the primary buffer witch is not visible and I only guess where are the buttons). I think this behavior is graphics driver and OS dependent but probably I'm not the only one who has this problem (no similar problems on Ubuntu but in Windows).

Does anyone have ideas how to bring the primary buffer to front?

(ps: feel free to correct my typos and give better title if you have better idea.)

EDIT: ok, I know I can buy a new monitor or run the app in windowed mode. But my question is about the full screen mode. And I forgot to mention if I'm unable to restart my program and the 2nd buffer got stuck the only way to escape from this situation is hitting reset.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯下孤影 2024-08-28 05:05:04

过去,推荐的解决方案是双屏调试。考虑到硬件解决方案相对便宜,它可能仍然是更好的选择。至少您可以同时看到程序的输出和调试器。

In the olden-days, the recommended solution was two-screen debugging. Given how relatively cheap the hardware solution is, it might still be a better way to go. You'd be able to see both your program's output and the debugger at the same time, at least.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文