Direct3d problems encountered in the project cause device loss

Source: Internet
Author: User

Today, when debugging the project, I encountered a problem. When I was writing code, debugging was conducted on a local computer. However, today, I logged on to the computer remotely for debugging, therefore, a problem occurs during the debugging process.

In fact, at the beginning, some colleagues said that when a remote login was made to play, another person logged in and started to quit on the playing side. Then the player crashed. Then I read the printed information and thought it was the cause of the system, the missing library, or the incomplete library.

However, due to the urgent need, I checked the cause carefully. When I looked at the crash, the Windows system prompts a d3d. dll error.

Today, when I remotely went to my development computer for debugging, I encountered a problem, that is, playing well. Then, when I minimized the entire Remote Desktop, back to the local computer, and back to the remote desktop, the player crashed.

So I followed the program carefully. In our player, d3d is used to display videos. The amount of code is not very large, so it is called printing information in important functions.

Finally, repeat the above action, the player crashes, and then you can view it. The Player crashes:

If (m_pd3dsurface [ddpos] = NULL) return nret;
Switch (m_pd3ddevice [ddpos]-> testcooperativelevel () {// test the device loss status, that is, to detect the current status of the device
Case d3d_ OK: // everything is normal
Break;
Case d3derr_devicelost: // The device is lost.
Closedirectdraw ();
If (! This-> initdirectdraw ())
{
Closedirectdraw ();

Return 0;
}
Break ;;
Case d3derr_devicenotreset: // reset lost, reset
// M_pd3ddevice [ddpos]-> Reset (0); // location of bug -----

M_pd3ddevice [ddpos]-> Reset (& d3dpp); // modefy by lhp --- solve the above crash problem

Closedirectdraw ();

 

So I checked the information on the Internet and carefully checked the cause. I thought it was a problem that the reset function was called after the device was lost.

 

The first two essays are my own searches. I personally think that the documents are complete and can solve the problem, so I posted them for future reference.

Direct3d problems encountered in the project cause device loss

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.