all the models disappear after change device!?!

Started by
2 comments, last by 88er 19 years, 6 months ago
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.
Advertisement
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
Chris ByersMicrosoft DirectX MVP - 2005
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 :)
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.

This topic is closed to new replies.

Advertisement