Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    C++ Draw a filled Triangle with Direct X 9


    Willi35
     Share

    Recommended Posts

    Here is my Function about to draw Triangle's with Color. Please make sure you give the right Corordinates to the Points in the clockwise. The picture will help you.

     

    122p0ns.jpg

     

    The oder from the Points is quotet in the DirectX-Help Instructions! There are not random.

     

     

    VOID DrawTriangleFilled(LPDIRECT3DDEVICE9 pDevice, float ax, float ay, float bx, float by, float cx, float cy, DWORD color)
    {
    #define Set_CustomerFVF (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
    
        struct DefineCustomerVertex
        {
            FLOAT x, y, z, rhw;
            DWORD color;
        };
    
        DefineCustomerVertex SetDrawPoints[3]=
        {
            {ax,ay,0.0f,1.0f,color},
            {bx,by,0.0f,1.0f,color},
            {cx,cy,0.0f,1.0f,color}
        };
    
        pDevice->SetFVF(Set_CustomerFVF);
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 1, SetDrawPoints, sizeof(DefineCustomerVertex));
    }
    

    Credits

    Willi27

    Edited by Willi35
    • Upvote 1
    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...