D3D: Device.Indices

From: Armin Zingler (az.nospam_at_freenet.de)
Date: 10/09/04

Date: Sat, 9 Oct 2004 11:50:07 +0200


among other steps, I do the following:

1. device.indices = MyIndexBuffer
2. render object
3. render mesh
4. device.indices = MyIndexBuffer
5. render object (same object as step 2)

At step 5: I get an exception. Debug output displays "Index stream does not
have required number of indices. DrawIndexedPrimitive failed."

After a long search, I found out that I must execute "device.indices =
nothing" between steps 4 and 5.

Possible explanation: The indexbuffer set in steps 1 and 4 is the same. The
property-set method compares the assigned indexbuffer to the one stored
before. As it is the same indexbuffer object, the buffer is not set again.
That's wrong, because, rendering the mesh, internally a different
indexbuffer has been set without altering the property device.indices. Can I
be right? If yes, is this a bug?

How to quote and why: