vertexcaching

Started by
1 comment, last by sipickles 18 years, 10 months ago
Hi, I have been playing with vertex caching, found here. I am having a bit of trouble tho, when it comes to the 'draw' call. HRESULT Draw(LPDIRECT3DDEVICE9 lpDevice,UINT numVertices,UINT numIndices,const WORD *pIndexData, const void *pVertexStreamZeroData) I have been calling: terrainCache->Draw(_device, _numVertices, _numTriangles * 3,_ib, _vb); but get this error: error C2664: 'Draw' : cannot convert parameter 4 from 'struct IDirect3DIndexBuffer9 *' to 'const unsigned short *' Has anyone else used this source code? WHat pointer am I supposed to be sending for pIndexData and pVertexStreamZeroData? Thanks Simon
Advertisement
The class contains its own D3D9 vertex and index buffer objects.. it seems you just feed it raw data to the Draw method (what you would feed to the objects between Lock and Unlock calls).

You appear to be feeding it supplemental vertex and index objects you've created yourself and already copied the vertex & index data to.

Doesnt that mean you are building triangle indexlists each frame?

This topic is closed to new replies.

Advertisement