Jump to content
  • Advertisement
Sign in to follow this  

2D HUD with D3DVERTEXELEMENT9 ?

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

Hi guys, I can't figure out how to display my 2D HUD. Before I was using a FVF with the D3DFVF_XYZRHW setting but now I'm using D3DVERTEXELEMENT9 for my vertices. Also, can I put the HUD quads in the same vertex buffer that I use for my 3D objects ? Maybe for the 2D stuff I have to do the transformations in a special 2D shader ? I'm lost. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Use POSITIONT.

My example with texture coords:

D3DVERTEXELEMENT9 VertPosRhwTexElements[] =
{
{0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0},
{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
D3DDECL_END()
};


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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!