Sign in to follow this  

[D3D9] Can't see anything after Device Reset

This topic is 3291 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

Hi all you helpfull people, I'm implementing a settings dialog in our 3D application to set graphic settings etc. So Obviously when graphic settings like resolution width/height( backbuffer width/height) changes, the IDirect3DDevice9 must be reset. I tried doing the following: OnLostDirect3DDevice(); m_d3dDevice->Reset( &this->m_d3dPresentParams ); OnResetDirect3DDevice(); But all that happens is that everything dissapears when the device is reset. I dont see anything anymore, except the typical grayish color of a Windows Form( the app is running in window mode for now). I do test the cooperative level every frame, and that does not bom out. I put a break point in the Renderer and can see that everything is rendered every frame. But I dont see anything? Can anybody think of something that I'm not doing that I should be doing? Thankss for you help in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by G-Man9566
Can anybody think of something that I'm not doing that I should be doing?
When you reset the device, it's put into the same state it was just after CreateDevice(). You'll need re-apply your textures, shaders, transform, render states, and so on.

I suspect you're not calling SetTransform() to re-set the view and projection (And possibly world) matrices.

Share this post


Link to post
Share on other sites
If you are not using the D3DPOOL_MANAGED flag when creating your resources, you must recreate them all. Resources include vertex/index buffers, models using ID3DXMesh, effects (FX files), textures and fonts.

Share this post


Link to post
Share on other sites
2 quick notes.

1) Always check the return value of Reset (and any other DX call that returns an HRESULT). While this might not be your issue, since you say the cooperative level is changing, this is good practice. The call could just the same have been failing, and you wouldn't have a clue.

2) For D3DX interfaces, you don't need to recreate them, you just need to call OnDeviceLost/OnDeviceReset.

Share this post


Link to post
Share on other sites
Quote:
Original post by G-Man9566
I found my problem, and it was the fact that I did not actually reset all my resources, I thought I did, but I didn't. So resetting all needed resources did the job. Thanks
If you haven't already, I'd highly recommend installing the Debug Runtimes, which would tell you that Reset() was failing, and tell you how many resources weren't reset.

Share this post


Link to post
Share on other sites

This topic is 3291 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this