Consequences of losing a device?

Started by
12 comments, last by Evil Steve 18 years, 1 month ago
Hello! I am programming with Direct3D 9 and I know that I should include something to handle a device lost. But I don't think I've actually ever lost a device! And don't say I didn't try, I've played with minimizing and alt-tabbing. Anyways, I'd like to know the following: 1- Under which circonstances may a direct3D device be lost? 2- What are the direct consequences of losing a device (textures, vertex buffers)? Thanks! EDIT: I think I've actually just lost my device! When A messagebox pops in my game while playing fullscreen, I don't seem to be able to continue playing...
Advertisement
1. Don't know.
2. I believe that you lose everything that was created using the device.

Dave
Would that mean something like :

- Textures
- Vertex / Index buffers
- ID3DXSprite / ID3DXMesh
- Render states

?
Not render states because you don't really create anything with them, you just change a device state.

Dave
Games to which I played, when minimized and maximized back, had no problem continuing to work. If the textures and buffers were lost, it should normally take some time before the game loads back every model and so. How do they manage to do this? Do they keep a copy of the data in CPU memory?
I don't think they actually lose the device when minimised. I am able to minimise my renderer with no consequences.

Dave
hi,

how far I know (I'm working with OGL)
you loose everything not created MANAGED,

btw: have you ever minimized half-life 2 and then returned to
the game, it takes a long time....


Marc
If the device was lost when minimised then my textures wouldn't show, but they do. I have no preventative measures in place to reload the textures if a device is lost.

Dave
perhaps they are created managed,

when you minimise gothic, and then maximize it back,
you have a short time no textures (some times)

and it uses directx
Thanks for all the info, I think I'm going to do like Dave : No preventive measures. This is my first game with direct3D, it's okay if there are some flaws like this, as long as it is playable!

This topic is closed to new replies.

Advertisement