Here is my code of the function in questiion:
void DrawScene(LPDIRECT3DDEVICE9 p_dx_Device, LPDIRECT3DVERTEXBUFFER9 p_dx_VertexBuffer, LPDIRECT3DINDEXBUFFER9 p_dx_IndexBuffer)
{
p_dx_Device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,60), 1.0f, 0);
p_dx_Device->BeginScene();
p_dx_Device->SetStreamSource(0, p_dx_VertexBuffer, 0, sizeof(OURCUSTOMVERTEX));
p_dx_Device->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
p_dx_Device->SetIndices(p_dx_IndexBuffer);
D3DXMATRIX m_Rotation;
D3DXMatrixRotationZ(&m_Rotation, flt_Angle);
D3DXMATRIX m_Translation;
D3DXMatrixTranslation(&m_Translation, 32, -32, 0);
D3DXMATRIX m_World;
D3DXMatrixMultiply(&m_World, &m_Translation, &m_Rotation);
p_dx_Device->SetTransform(D3DTS_WORLD, &m_World);
p_dx_Device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, int_VertCount, 0, int_PrimCount);
p_dx_Device->EndScene();
p_dx_Device->Present(NULL, NULL, NULL, NULL);
}
the following line is the error line:
p_dx_Device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, int_VertCount, 0, int_PrimCount);
when i build it, no errors occur, however upon running i get:
Unhandled exception at 0x4ff4f522 in testdx.exe: 0xC0000005: Access violation reading location 0x00231ad8.
now i have done a little debugging already. i have found that none of my variables or pointers to variables in my entire program are set at memory location 0x00231ad8, or any where close for that matter. I bring up the memory listing for that area, and there are "?" all over.... the closest variable that the function DrawIndexedPrimitive should use (and that my program includes) is at 0x002197c0, and none of the relevant variables would indicate any entries out of the range of that vector.
my question is more along the lines of "why is it trying to access this memory location if none of my pointers or variables indicate values needed are there? and how do i solve this annoying little error?" i am at wits end.
Any Help would be much appreciated.
Thanks.