OpenGL 远程崩溃

来源:互联网 发布:java d3.js 编辑:程序博客网 时间:2024/05/17 05:23
公司的程序用OpenGL写的,本地运行良好,但是一远程就出各种问题,找了好久一直没有结果,后来在微软的官方论坛,某个小角落发现了有哥们也遇到这种问题,原来,OpenGL程序在Remote Desktop中崩溃是个硬伤,有人推荐用VirtualGL,不过

EnumDisplayDevices function貌似可以缓解下这个问题。

http://msdn.microsoft.com/en-us/library/dd162609(v=vs.85).aspx

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. The function fails if iDevNum is greater than the largest device index.

Remarks

To query all display devices in the current session, call this function in a loop, starting withiDevNum set to 0, and incrementing iDevNum until the function fails. To select all display devices in the desktop, use only the display devices that have the DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag in theDISPLAY_DEVICE structure.

To get information on the display adapter, call EnumDisplayDevices withlpDevice set to NULL. For example, DISPLAY_DEVICE.DeviceString contains the adapter name.

To obtain information on a display monitor, first call EnumDisplayDevices withlpDevice set to NULL. Then call EnumDisplayDevices withlpDevice set to DISPLAY_DEVICE.DeviceName from the first call toEnumDisplayDevices and with iDevNum set to zero. Then DISPLAY_DEVICE.DeviceString is the monitor name.

To query all monitor devices associated with an adapter, call EnumDisplayDevices in a loop withlpDevice set to the adapter name, iDevNum set to start at 0, andiDevNum set to increment until the function fails. Note that DISPLAY_DEVICE.DeviceName changes with each call for monitor information, so you must save the adapter name. The function fails when there are no more monitors for the adapter.