如何检测哪个屏幕是OSVR耳机?

How to detect which screen is the OSVR headset?

我有一个 WPF+SharpDX Windows 应用程序,它通过全屏 window 在作为 HDK 的屏幕上显示到 OSVR HDK。此设置运行良好,但需要用户说明 HDK 在哪个屏幕上。

我希望自动检测到它,但在 API 屏幕上没有看到任何内容是耳机。

目前我在 window:

中渲染
var bounds = dxgiDevice.Adapter.Outputs[_selectedOutput].Description.DesktopBounds;
form.DesktopBounds = new System.Drawing.Rectangle(
    bounds.X, bounds.Y, bounds.Width, bounds.Height);

_selectedOutput正是我要找的东西。

我目前不支持直接模式,我使用的是 Managed-OSVR。该应用程序将于 Windows 8/8.1/10.运行。

我已经有一段时间没有为 OSVR 编写任何代码了,但这是我记得的: 如果您 运行 处于扩展模式,则 OSVR 将被视为常规显示器。您可以像任何其他屏幕一样重新排列它。输出位置可以在 OSVR 配置文件中配置。 我使用以下 (Java) 检索位置和大小以设置我的 window:

osvrContext.getRenderManagerConfig().getXPosition()
osvrContext.getRenderManagerConfig().getYPosition()
osvrContext.getDisplayParameters().getResolution(0).getWidth()
osvrContext.getDisplayParameters().getResolution(0).getHeight()

澄清一下:我不知道您是否可以在扩展模式下检索显示器的 ID。据我所知,它仅定义为桌面上的位置和大小。 希望对你有所帮助。