• Advertisement
Sign in to follow this  

New to this vertex format

This topic is 2240 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

So for some time I've been using the DirectX's Flexible Vertex Format, but I soon learned it was ironically not so flexible, so I used the other method, Vertex Declerations.

Now I'm new to both, and I know I'm certainly doing something wrong. The program is supposed to draw a triangle. It's not even supposed to be transformed into a 3d world (hence 2D), so it's fairly simple. I'm trying to emulate the FVF flags (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)

The header.
http://pastebin.com/EM9inCg1

The main.
http://pastebin.com/KNRGfejt


It's supposed to simply draw a triangle with diffused colors, but it's invisible. When I debugged it, DirectX did not complain. When I debugged it through PIX, I was guaranteed the vertices and their colors were exactly what I set them to be.

So why is it invisible?

Share this post


Link to post
Share on other sites
Advertisement
Your handling of isbufferdec_set looks strange to me - vertex declarations should be set at run time, not creation time.

Hint: try using D3DXDeclaratorFromFVF for troubleshooting this kind of thing - it's a great way to learn how common FVFs map to vertex declarations.

Share this post


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

  • Advertisement