Update:
When i press Control Alternative Delete, Direct3D Device get lost.
I restore it using recreation.
It works for windowed mode and failed for fullscreen mode.
I get
HRESULT: 0x88760868 (2289436776)
Name: D3DERR_DEVICELOST
Description: Device lost
Severity code: Failed
Facility Code: Unknown (2166)
Error Code: 0x0868 (2152)
as result of
hr = m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
m_hWndFocus,
D3DCREATE_HARDWARE_VERTEXPROCESSING |
D3DCREATE_PUREDEVICE
, &m_d3dpp,
&m_pd3dDevice );
ZeroMemory( &m_d3dpp, sizeof(m_d3dpp) );
m_d3dpp.Windowed = m_bWindowed;
m_d3dpp.BackBufferCount = 1;
if( m_bWindowed )
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
else
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_d3dpp.EnableAutoDepthStencil = FALSE;
m_d3dpp.AutoDepthStencilFormat = D3DFMT_X8R8G8B8;
m_d3dpp.hDeviceWindow = m_hWnd;
if( m_bWindowed )
{
m_d3dpp.BackBufferWidth = CONST_BackBufferWidth;
m_d3dpp.BackBufferHeight = CONST_BackBufferHeight;
m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
m_d3dpp.FullScreen_RefreshRateInHz = 0;
}
else
{
m_d3dpp.BackBufferWidth = CONST_BackBufferWidth;
m_d3dpp.BackBufferHeight = CONST_BackBufferHeight;
m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
}
m_d3dpp.Flags = D3DPRESENTFLAG_VIDEO;
m_d3dpp.MultiSampleQuality = D3DMULTISAMPLE_NONE;
m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
hr = m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
m_hWndFocus,
D3DCREATE_HARDWARE_VERTEXPROCESSING |
D3DCREATE_PUREDEVICE
, &m_d3dpp,
&m_pd3dDevice );
ShowWindow(m_hWnd,SW_SHOWMAXIMIZED);
Device can not be restored until if there is TestCooperativeLevel and it returns D3DERR_DEVICENOTRESET.
But it never happens in fullscreen mode.
Is it directx, display driver or nvidia stereo 3d video driver bug?
What should i do to resolve it?
Update:
When comes next media sample, i try to render it.
First i check if there is the device.
There is no device.
I try to restore it.
I get D3DERR_DEVICELOST result code.
The same for all next frames (media samples).
I tryed to use all Direct3D function in separate thread, but it gave no result.
It is actual.