help~ Lost & Reset D3DDevice error

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

chendot
Just popping in
Just popping in
Posts: 10
Joined: Wed Jan 09, 2008 13:22

help~ Lost & Reset D3DDevice error

Postby chendot » Thu Mar 06, 2008 05:24

Hi,
I've got a problem like this, I used d3d and CEGUI in my project, and when I change the program between window mode and fullscreen mode or resize the window form, I should lost and reset the d3ddevice as below.

Code: Select all

case WM_SIZE:
   // ...
   OnLostDevice();
   m_pD3DDevice->Reset(&m_D3DPP);
   OnResetDevice();
   // ...

everything goes ok before I add CEGUI. when I added CEGUI to my project, and the m_pDX9Renderer->preD3DReset() and postD3DReset() methods are added in OnLostDevice() and OnResetDevice() sparately. it always report error at reset(&m_D3DPP) step. any advice please...Are these enough when reset the D3D device? many thanks!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Mar 06, 2008 09:56

Hi,

I did not personally test this yet as I'm not on Windows much, in the mean time if you can give any additional information regarding the exact error you're getting from the call to Reset, that would be most helpful.

I'll try to test the reset logic for myself later on today, though I can't promise that I will get to it until maybe the weekend.

CE.

chendot
Just popping in
Just popping in
Posts: 10
Joined: Wed Jan 09, 2008 13:22

Postby chendot » Thu Mar 06, 2008 11:26

Hi CE, thank you for replying:)

The output information about this error is "d:\projects\cfscene\cfd3dapp.cpp(176): m_pD3DDevice->Reset(&m_D3DPP) hr=D3DERR_INVALIDCALL (0x8876086c)", and I guess it cause by the CEGUI::DirectX9Renderer object fail to Lost D3D device, which I first thought preD3DReset should help to do that.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Mar 06, 2008 19:23

Hello,

thanks for the extra information. You are correct that this call should allow the device reset to proceed. It seems that we are not releasing something that we should be; I did not get a chance to look at this today, but will definitely get around to it tomorrow.

By all accounts it's a bug in the renderer module, so has been added to mantis as ticket #174. I'll update the ticket after I've confirmed this issue tomorrow.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Mar 07, 2008 12:05

Hi,

I have tested this and was unable to reproduce the issue. I added logging calls to the D3D9 renderer to log when the pre/post reset calls are made, and rigged the test framework to run fullscreen and did alt-tab to cause the device to be lost (don't ask, it was the easiest way to run a test of the device lost handling built into the example framework). Upon re-activating the demo app, everything was restored as it should be, with the pre/post reset calls being logged.

"D3DERR_INVALIDCALL" is supposed to signal that the call / argument value is incorrect rather than the device still being lost (in which case the return should have been D3DERR_DEVICELOST).

I'm not sure what else to suggest at the moment, since it all appears to work ok here. If you could do some more checking and maybe create a minimal example that sill exhibits the behaviour and report back, I'll check it again.

CE.

chendot
Just popping in
Just popping in
Posts: 10
Joined: Wed Jan 09, 2008 13:22

Postby chendot » Sun Mar 09, 2008 16:59

Hi CE,

My mistake :oops: , I've found what the problem is. Originally I call the OnResetDevice() at the constructor, that cause the error after adding the postResetD3D() to OnResetDevice() method.

Thank you for your attention:)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Mar 09, 2008 17:30

:D

Thanks for letting me know; I'll close the mantis ticket.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests