Archived

This topic is now archived and is closed to further replies.

Creating an LPD3DXMESH

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

I am trying to create an LPD3DXMESH, but every time I call D3DXCreateMesh I just get D3DERR_INVALIDCALL. This is what I am doing:
  
	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;
	}

  
NumTriangles and NumVertex are 1102 and 942 respectivly. Any ideas? Alan

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites