Sign in to follow this  

VertexDeclaration for RHW

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

How do I define the VertexDeclaration for the RHW?
typedef struct {
	FLOAT x, y, z;     // 2-D coordinates
	FLOAT rhw;         // rhw
	FLOAT u, v;        // Texture coordinates
} sVertex_2D;
#define VERTEXFVF_2D (D3DFVF_XYZRHW | D3DFVF_TEX1)

D3DVERTEXELEMENT9 decl_2D[] = 
{
	// offsets in bytes
	{0,  0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
	{0, 12, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, ??,   0},
	{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,   0},
	D3DDECL_END()
};

[Edited by - akira32 on March 20, 2008 5:11:45 AM]

Share this post


Link to post
Share on other sites
Thank you,jollyjeffers.
I had solved it.

D3DVERTEXELEMENT9 decl_2D[] =
{
// offsets in bytes
{0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0},
{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
D3DDECL_END()
};



Mapping FVF Codes to a Direct3D 9 Declaration (Direct3D 9)

[Edited by - akira32 on March 20, 2008 6:11:18 AM]

Share this post


Link to post
Share on other sites

This topic is 3556 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this