Jump to content
  • Advertisement
Sign in to follow this  
SouthernMunk

DirectX troubles???

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having trouble with the DrawPrimitive() method. All I'm trying to do is draw a single diffused triangle, but the triangle just appears black. I don't know if this is because of my failing video card or because I'm doing something wrong programatically. Can anyone help me out? EDIT: You can grab the source here: http://members.optusnet.com.au/~smains/ocau/DirectXSetup.zip

Share this post


Link to post
Share on other sites
Advertisement
Your not telling the device what type of FVF to use. It doesn't know that your vertices are colored and what not.

Example:

struct COLORVERTEX
{
D3DXVECTOR3 v;
D3DCOLOR color;
FLOAT tu;
FLOAT tv;

static const DWORD FVF;
};
const DWORD COLORVERTEX::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1;
device->SetFVF( COLORVERTEX::FVF );
device->SetStreamSource( 0, m_pGroundVB, 0, sizeof(COLORVERTEX) );
device->SetIndices( m_pGroundIB );
device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, m_dwNumGroundVertices, 0, m_dwNumGroundIndices/3 );


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!