Jump to content


Device reset and state block?


1 reply to this topic

#1 yakul

    Member

  • Members
  • PipPip
  • 55 posts

Posted 04 March 2008 - 01:20 PM

I wish to reset my IDirect3DDevice9, if its because it is lost or because I want to change window dimensions.
I have created a list with a Device wrap class that release all the interfaces created with that device.
However, when I get to the reset function of IDirect3DDevice9, I get the debug output:
Direct3D9: (ERROR) :All user created stateblocks must be freed before Reset can succeed. Reset Fails.
Direct3D9: (ERROR) :Reset failed and Reset/TestCooperativeLevel/Release are the only legal APIs to be called subsequently

I don't create any StateBlock interface, so why does it tell me I need to free them?
Am I not freeing something? But I called release on all the interfaces I created with this device?
What can it be?

Edit: Sorry to ask for something I discovered a short time later.
But I saw that I needed to also release the ID3DXEffect interface for the reset to work. How come? I thought it doesn't need to be reset.

#2 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 04 March 2008 - 03:23 PM

yakul said:

I saw that I needed to also release the ID3DXEffect interface for the reset to work.
Yes, D3DX uses the same Direct3DDevice9 interface you are using. And it frequently creates state blocks. So you have to release all interfaces to D3DX objects as well before calling Reset.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users