Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Uriel

Cannot reset device

This topic is 5294 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I tried to add DEVICELOST support in my game, but Reset returns fail and i dont know what to do now. Before calling Reset on device i release all textures/surfaces/VB that uses D3DPOOL_DEFAULT memory. I also make sure that im in D3DERR_DEVICENOTRESET state. I have never done lost device handling before so im not sure what else should i release.. i have stencil shadows, env bumpmaps (i release render targets i use for env maps), DirectSound (i dont release anything here). Please shed some light on me...

Share this post


Link to post
Share on other sites
Advertisement
After checking what stateblocks are, i can assure you that i dont use them.

I also didnt create any additional swap chains.
I do use stencil buffer but i dont create any stencil surface..

Share this post


Link to post
Share on other sites
Which error code does it return? There are five possibles, according to the DXSDK:

quote:


  • D3DERR_DEVICELOST : The device has been lost but cannot be reset at this time. Therefore, rendering is not possible.
  • D3DERR_DRIVERINTERNALERROR : Internal driver error. Applications should generally shut down when receiving this error.
  • D3DERR_INVALIDCALL : The method call is invalid. For example, a method''s parameter may have an invalid value.
  • D3DERR_OUTOFVIDEOMEMORY : Direct3D does not have enough display memory to perform the operation.
  • E_OUTOFMEMORY : Direct3D could not allocate sufficient memory to complete the call.


Share this post


Link to post
Share on other sites
Do you use ID3DXFont? If so it needs to be released and reset when you reset your deivce. It has its own methods OnLostDevice() and OnResetDevice().

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What does the debug runtime tell you ? It should give you a hint which kind of resource hasn''t been released yet.
Also all bound texture interfaces have to be released.

Share this post


Link to post
Share on other sites
@__Daedalus__:

Now i call OnDeviceLost on fonts and my mesh manager loads meshes with D3DXMESH_MANAGED option. However Reset() still fails.
There are few TextMeshes that i create using D3DXCreateText. Im not sure what memory they allocate..

@ superpig:

The problem is, it does not return any of those.. in docs it is said that those are just some of possible errors..

@Anonymous Poster:

I just turned debug on in dx for my first time (i coded for a year and i had no clue that there is smth like that - no comments) and my app crashes. Even if debug lvl is set to lowest, when i run app it halts on code where i create render target surface..

Share this post


Link to post
Share on other sites
eh.. now i even release those meshes created using D3DXCreateText, and still Reset() fails..

Share this post


Link to post
Share on other sites
quote:
Original post by Uriel
@ superpig:

The problem is, it does not return any of those.. in docs it is said that those are just some of possible errors..


For such a thing to happen is extremely rare... still, if it wasn''t one of those, then what was it? Get the HRESULT that it returns, and then feed that into the "DirectX Error Lookup" program that comes with the SDK.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!