Search code examples
cwindowsdirectxdirectx-9

What messages are sent when I call IDirect3DDevice9::Reset


The MSDN documentation (http://msdn.microsoft.com/en-us/library/bb174425%28v=vs.85%29.aspx) says that "Direct3D 9 applications can expect messages to be sent to them during this call." Exactly what messages should the application expect to be sent to its WndProc function?


Solution

  • As far as I know, it just means "the usual messages". As in, messages will be sent normally to your app, so you'll still receive messages when the mouse moves, or if the user tries to close the window, or any of the other events that cause messages to be sent to your process.

    I believe they're simply saying that you have to be sure you handle this situation (if the mouse moves, don't try to redraw the cursor if the device is in the middle of resetting)

    Keep in mind that Direct3D and the Windows message pump (or for that matter, the entire window manager) know nothing about each others. That's why you have to do all the hard work when switching between windowed and full screen mode, for example. DirectX only knows about the device and how to write to the HDC it's bound to. It doesn't send you any special messages, and it doesn't handle any messages for you.

    So they're simply saying "don't assume that Windows will stop sending you messages just because your device is in busy resetting".