Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: [D3D] DrawIndexedPrimitive problem

  1. #1

    [D3D] DrawIndexedPrimitive problem

    Hi all.

    I recently discovered a bug in my engine. It's about the DrawIndexedPrimitive routine.
    Earlier versions of my engine worked fine, but after some major changes, something went wrong. :cry:

    Fortunatly i was able to reproduce the bug. I used one of clooties D3D samples.
    You can download the source here

    {It took some time to find free webspace..i hope the download works }

    I created a triangle (3 Vertices) and an IndexBuffer with 3 Indices. And then i wanted to render it using the following call:

    [pascal]
    g_pd3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELI ST, 0,3 ,0, 1);
    [/pascal]

    Wich is a good call in this case, if i'am not mistaking. :?
    Unfortunatly Nothing was rendered. :cry:

    But i also tried this:

    [pascal]
    g_pd3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELI ST, 0,2 ,0, 1);
    [/pascal]

    Wich resulted in this:


    And when i Increased the primitivecount.... like this:

    [pascal]
    g_pd3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELI ST, 0,3 ,0, 2);
    [/pascal]

    The Triangle was rendered correctly like shown below:


    Can someone explain me, why the first call didn't work and the third did work??

    Thanx for your help
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    [D3D] DrawIndexedPrimitive problem

    I have run your app and I've got the third (correct) image.
    I have GeForce 6600 GT 128MB (Forceware 84.21).

  3. #3

    [D3D] DrawIndexedPrimitive problem

    hi.. which OS are you running??

    I tested this code both on W98 and WXP. I noticed that Only Win98 had the problem.

    The specs:
    >Win98: DirectX 8.1b nVidia GeForce 2 MX/MX 400
    >WinXP: DirectX 9.0c ATI Radeon X300

    Do you guys think i should worry about this bug??
    Yeah.. i know... its W98.. very old, and maybe unstable. On the other hand.. it can be my code's fault.

    Do you guys think this can be fixed by changing some of the code, or is this a W98/DX8 bug?? :? :?

    Edit: I have the latest drivers
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4

    [D3D] DrawIndexedPrimitive problem

    which OS are you running??
    WinXP + DirectX 9.0c.

    On the other hand.. it can be my code's fault.
    I know very little of D3D but your code looks good to me. Sorry I can't help you more

  5. #5

    [D3D] DrawIndexedPrimitive problem

    here this one works correctly:
    [pascal] g_pd3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELI ST, 0, 3, 0, 1);
    [/pascal]
    If i try to use:
    [pascal] g_pd3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELI ST, 0, 3, 0, (2));
    [/pascal]
    - DirectX debug runtime complains:
    ODS: Direct3D8: (ERROR) :Index stream does not have required number of indices. DrawIndexedPrimitive failed.
    Process Vertices.exe (2504)
    -------
    WinXP SP2, DX9.0c, GF6600.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  6. #6

    [D3D] DrawIndexedPrimitive problem

    ah.. its working correctly on your machine.

    I like to see a list of debug messages on my machine. Where do i get the DX debugger and how does it work

    Does anyone still have a W98 machine standing in some dusty corner?? can you test this app please??
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  7. #7

    [D3D] DrawIndexedPrimitive problem

    You should find DirectX 8 or 9 SDK that installs on Win98...
    There are only 10 types of people in this world; those who understand binary and those who don't.

  8. #8

    [D3D] DrawIndexedPrimitive problem

    I have just installed the DX 8 SDK.
    But i didnt figured out how to turn on the DX Debugger {I downloaded this SDK using P2P so i dont know wether everything works correctly or not}

    i have read some pages about DX debugging, but everyone says i must click on the DX icon on my control panel, but i cant find any DX icon there.

    Do you know an alternative way of enabling the debugger. Or do you have a link to a DX 9 SDK for W98
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  9. #9

    re

    I have windows Xp profesional; but i just have directX 8 instaled, When I run your program i get just an empty windows with blue background, but no any message error.

    I checked your code and i dont found anything wrong; i was looking for any wrong declared data size, but i found none; i dont have the units for compile your code so I did not experiment any furter, but i sugest try to change your index data size from unsigned 32 bits to 16 bits and see how it runs.

  10. #10

    [D3D] DrawIndexedPrimitive problem

    I use clooties headers: click here

    I will try the 16bit Indices. I dont really understand why this could solve the problem... but its worth a try :razz:
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Page 1 of 2 12 LastLast

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
  •