Results 1 to 2 of 2

Thread: Problem: CreateVertexBuffer

  1. #1

    Problem: CreateVertexBuffer

    I'm doing simple experiments with clootie's tutorial No. 4 (Lighting). I tried to create a second cylinder.

    It works well with 100 instead of 50 vertices in the CreateVertexBuffer-command:

    g_pd3dDevice.CreateVertexBuffer(100*2*SizeOf(TCustomVertex),
    0, D3DFVF_CUSTOMVERTEX,
    D3DPOOL_DEFAULT, g_pVB, nil))

    and another for-loop for index 50 to 99:

    g_pd3dDevice.CreateVertexBuffer
    g_pVB.Lock
    vertex-definition cylinder 1 (0...49)
    vertex-definition cylinder 2 (50...99)
    g_pVB.Unlock


    But when I try do it this way:

    g_pd3dDevice.CreateVertexBuffer
    g_pVB.Lock
    vertex-definition cylinder 1
    g_pVB.Unlock

    g_pd3dDevice.CreateVertexBuffer
    g_pVB.Lock
    vertex-definition cylinder 2
    g_pVB.Unlock

    one cylinder looks good and the second is totally corrupted:



    Any idea?

    Carsten

  2. #2

    Problem: CreateVertexBuffer

    sorry - I have tried a lot before I wrote the Posting above. I found the fault now - something was wrong with the streams.

    Carsten

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •