|
|
发表于 2005-7-17 16:19:00
|
显示全部楼层
Re:d3d9全屏后切换出去再换回来就一直卡着,怎么办?
可能是D3D设备丢失,楼主可以在渲染函数里加入一个D3D设备的函数来检查是否设备丢失.
g_pD3DDEVICE->TestCooperativeLevel()
如果返回D3DERR_DEVICELOST则表示设备已经丢失不可能再渲染
关于这个函数的说明:
IDirect3DDevice9::TestCooperativeLevel Method
--------------------------------------------------------------------------------
Reports the current cooperative-level status of the Microsoft Direct3D device for a windowed or full-screen application.
Syntax
HRESULT TestCooperativeLevel(VOID);
Return Value
If the method succeeds, the return value is D3D_OK, indicating that the device is operational and the calling application can continue.
If the method fails, the return value can be one of the following values (see Remarks).
D3DERR_DEVICELOST: The device has been lost but cannot be reset at this time. Therefore, rendering is not possible.
D3DERR_DEVICENOTRESET: The device has been lost but can be reset at this time.
D3DERR_DRIVERINTERNALERROR: Internal driver error. Applications should generally shut down when receiving this error. For more information, see Driver Internal Errors.
|
|