• Advertisement
Sign in to follow this  

Vertex buffer creation problem

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

Hello! I have a stupid problem... I'm trying to create a Vertex Buffer and it always fails. This must be a problem with my D3DUSAGE and D3DPOOL but I cannot find it out even with the help of msdn. This vertex buffer will hold 4 vertices, to draw a quad to be used for drawing sprites. This is my code :
struct SQuadVertex

D3DXVECTOR3 position;
DWORD       color;
float       u,v;

const static DWORD FVF;

const DWORD FE2D::CRenderer::SQuadVertex::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1;

_D3DDevice->CreateVertexBuffer(4 * sizeof(SQuadVertex), D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, SQuadVertex::FVF, D3DPOOL_MANAGED, &_Vertexbuf, NULL);

I get a D3DERROR_INVAlIDCALL error... anyone knows what I'm doing wrong? [Edited by - Trillian on March 31, 2006 9:56:30 PM]

Share this post

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

  • Advertisement