Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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
    // Create the device
    hr = m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
                               m_hWndFocus, 
          D3DCREATE_HARDWARE_VERTEXPROCESSING |
                                        D3DCREATE_PUREDEVICE
          , &m_d3dpp,
                               &m_pd3dDevice );
 
//  Set up the presentation parameters
    ZeroMemory( &m_d3dpp, sizeof(m_d3dpp) );
    m_d3dpp.Windowed               = m_bWindowed;
    m_d3dpp.BackBufferCount        = 1;
    if( m_bWindowed )
        m_d3dpp.MultiSampleType    = D3DMULTISAMPLE_NONE;//pDeviceInfo->MultiSampleTypeWindowed;
    else
        m_d3dpp.MultiSampleType    = D3DMULTISAMPLE_NONE;//pDeviceInfo->MultiSampleTypeFullscreen;
    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;
 

 

    // Create the device
    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.
Posted 17-Feb-11 3:07am
Edited 4-Apr-11 22:59pm
v15
Comments
SK Genius at 18-Mar-11 9:56am
   
The error code says that you made an invalid call to the function. Could you post a code snippet showing how and where you reset the device?
Kozlov_Sergey at 21-Mar-11 3:39am
   
I do not get resolution to recreate device, but do it. That is why i have got this error code.
Kozlov_Sergey at 21-Mar-11 7:57am
   
I decided do not use Reset function, because it always fails. Now i use recreation.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please check the following link it might help you
 
http://www.gamedev.net/topic/312957-lost-device-in-d3d/
  Permalink  
v2
Comments
JF2015 at 18-Feb-11 1:50am
   
Fixed the link.
Kozlov_Sergey at 18-Feb-11 9:25am
   
There is only general proposition. I have used it in my program.
Kozlov_Sergey at 18-Mar-11 8:18am
   
But the problem stays. No "do reset" message received.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Its a long time ago at DX7. At this time we have to gain a new back- and frontbuffer if the viewport size has changed. But thats no problem: the meshes and textures still exist anyway.
But dont ask me for code, im afraid that i couldnt find it.
Regards.
  Permalink  
Comments
Kozlov_Sergey at 23-Mar-11 10:44am
   
I have no textures and meshes. Function Reset does not work and recreating does not work. The problem is that, after device was lost, only some functions of the device work. Recreating device fails.
mbue at 23-Mar-11 13:11pm
   
Enshure to release all interfaces you have got (if(pBuffer) pBuffer->Release(); pBuffer=0;). If you dont, the interfaces will go into a zombie-state.
Kozlov_Sergey at 25-Mar-11 6:10am
   
I release all interfaces. But after that i cannot recreate interface LPDIRECT3DDEVICE9 object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 sanket saxena 335
1 Abhinav S 333
2 Sergey Alexandrovich Kryukov 275
3 OriginalGriff 235
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 5 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid