Hi
Been trying to integrate Cal3D into my D3D9b game, and
discovered this:
For some reason, if using the code directly from the D3D
Miniviewer application, multiple model instances will not
render correctly into a shared vertex buffer, one after
another.
Workaround: Don't share the vertex buffer between
instances. This is hardly ideal, though.
Could someone see if they can reproduce this, and
hopefully provide a better fix for it than mine?
I have a feeling that it is caused by the D3DLOCK flags,
or the order in which things are done with binding the
VB, etc.
It's bugged, anyway.
Logged In: NO
sorry, my email is codemonkey@orcon.net.nz
Logged In: NO
Here's a solution:
Init the m_VBCursor and m_IBCursor variables when you set
up the class instance.
Then, DONT set them to zero at the beginning of each
rendering cycle. You can't use D3DLOCK_NOOVERWRITE, then
write to the memory you just wrote to :P, the flag is
supposed to be an indication that you *won't* do that, so
you don't stall the GPU.
-Codemonkey