Previous 199869 Revisions Next

r22967 Sunday 19th May, 2013 at 22:30:52 UTC by Ryan Holtz
Reset D3D device before destroying device. Fixes crash when selecting games from internal menu with HLSL enabled. nw
[src/osd/windows]drawd3d.c

trunk/src/osd/windows/drawd3d.c
r22966r22967
794794   if (m_device != NULL)
795795   {
796796      if (device_test_cooperative())
797      {
797798         return 1;
799      }
798800   }
799801
800802   // in window mode, we need to track the window size
r22966r22967
10011003                                       video_config.waitvsync || video_config.syncrefresh) ?
10021004                                       D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
10031005
1004   printf("m_device is %08x%08x\n", (UINT32)((UINT64)m_device >> 32), (UINT32)((UINT64)m_device & 0x00000000ffffffff));
10051006   // create the D3D device
1006   result = (*d3dintf->d3d.create_device)(d3dintf, m_adapter, D3DDEVTYPE_HAL, win_window_list->hwnd,
1007   result = (*d3dintf->d3d.create_device)(d3dintf, m_adapter, D3DDEVTYPE_HAL, m_window->hwnd,
10071008               D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &m_presentation, &m_device);
10081009   if (result != D3D_OK)
10091010   {
r22966r22967
10131014      {
10141015         m_create_error_count++;
10151016         if (m_create_error_count < 10)
1017         {
10161018            return 0;
1019         }
10171020      }
10181021
10191022      //  fatal error if we just can't do it
r22966r22967
11541157
11551158   // free the device itself
11561159   if (m_device != NULL)
1160   {
1161      (*d3dintf->device.reset)(m_device, &m_presentation);
11571162      (*d3dintf->device.release)(m_device);
1163   }
11581164   m_device = NULL;
11591165}
11601166

Previous 199869 Revisions Next


© 1997-2024 The MAME Team