Skip to main content
gamedev.net
🔒 Locked

Vertex buffer creation problem

Started by Trillian Mar 31, 2006 at 9:25 PM 1 replies 550+ views
Original Post
Trillian
Trillian
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]
chema
chema
Hi,

I have found this article about Direct3D resource management very useful to understand how Resources, Pools and Usage are related.

By the way, this is not a stupid problem if you learn something solving it!

Greetings,

Chema
///////////////////////////// Good luck, // // you will need it! /////////////////////////////Chema

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.