LPD3DXMESH Mesh = NULL;
DWORD fvf = D3DFVF_XYZ | D3DFVF_TEX0;
HRESULT res = D3DXCreateMesh(NumTriangles, NumVertex, D3DXMESH_MANAGED | D3DXMESH_DYNAMIC, &fvf, g_Renderware.m_lpDevice, &Mesh);
if (FAILED(res))
{
char buf[512];
memset(buf, 0, 512);
D3DXGetErrorString(res, buf, 512);
MessageBox(NULL, buf, "", MB_OK);
return NULL;
}
Creating an LPD3DXMESH
I am trying to create an LPD3DXMESH, but every time I call D3DXCreateMesh I just get D3DERR_INVALIDCALL.
This is what I am doing:
NumTriangles and NumVertex are 1102 and 942 respectivly.
Any ideas?
Alan
also, i think you might have a problem trying to use MANAGED and DYNAMIC together. i seem to remember running into that problem. and here''s a quote from the DX docs on buffer creation:
In fact, index buffers and vertex buffers cannot be created using D3DPOOL_MANAGED together with D3DUSAGE_DYNAMIC.
In fact, index buffers and vertex buffers cannot be created using D3DPOOL_MANAGED together with D3DUSAGE_DYNAMIC.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement