Sign in to follow this  
88er

all the models disappear after change device!?!

Recommended Posts

win2000 sp4 + dx9c I load a teapot model in the scene, but it appear after i change device.Then I use debug runtime,it report "this device can't set indics".All the resource create with D3DPOOL_MANAGED,include index buffer,but where is bug.

Share this post


Link to post
Share on other sites
Did you mean to say that the teapot model disappears after you change the device? What do you mean by change the device? If you release a device and create a new one (whether it is the same or not), all state settings and memory allocations (such as meshes and textures) will be lost. If you Reset the device, then managed items will be reset automatically. Maybe this is what you're thinking of. If you don't have a device initialized, I can see you getting a similar error if you tried to call SetIndices with an index buffer that's no longer valid.

Chris

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well ive only stareted with Managed DX9 today so sorry if im way off base with this advice.
But from what i have read all graphical resources in video memory are disposed of when the device is reset (through things like window resizing, selecting another device, etc) so you need to write an event that fires when your buffer is created, an event that writes the information back into the buffer.

Again sorrry if im not understanding the problm as ive only been at this 2 or 3 hours... but ive got a nice model textured and spining away in D3D :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Supernat02
Did you mean to say that the teapot model disappears after you change the device? What do you mean by change the device? If you release a device and create a new one (whether it is the same or not), all state settings and memory allocations (such as meshes and textures) will be lost. If you Reset the device, then managed items will be reset automatically. Maybe this is what you're thinking of. If you don't have a device initialized, I can see you getting a similar error if you tried to call SetIndices with an index buffer that's no longer valid.

Chris


I consider all the events that change device do the same action,
so i didn't recreate anything after change the device resolusion
and depeth.I'll try again,thank you all.

Share this post


Link to post
Share on other sites

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