Original Post
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 : I get a D3DERROR_INVAlIDCALL error... anyone knows what I'm doing wrong? [Edited by - Trillian on March 31, 2006 9:56:30 PM]
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);