Ok I removed this question and decided to ask a new one, relating to the same thing.
I keep on getting a Access Violation whenever I try to use drawindexedprimitive...
p_dev->SetIndices( idxBuff );
hr = p_dev->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, totalVerts, 0, numPolys );
int m_cols = 20;
int m_rows = 20;
polySize = m_cols * m_rows * 2;
numInd = polySize * 3;
numPolys = m_cols * m_rows * 2;
totalVerts = (m_cols+1) * (m_rows+1);
vertices = new vtx[ totalVerts ];
I created a vertex buffer of totalVerts * sizeof( vtx ) size, as is usual.
vtx is a struct with a D3DXVECTOR3 position vector and a color value.
I created an indexbuffer with a size of numInd size, which in this case is 2400 indices total. 20 * 20 * 3(vertices per triangle) * 2(triangles per "square")
But I must be setting something wrong because of the access violation, but I can't seem to see what.
[Edited by - dpro on May 22, 2006 5:00:53 PM]