Menu

#52 D3D Miniviewer code doesnt work with multiple model instance

open
nobody
5
2004-09-21
2004-09-21
Anonymous
No

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.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    sorry, my email is codemonkey@orcon.net.nz

     
  • Nobody/Anonymous

    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

     

Log in to post a comment.

Auth0 Logo