My Menu working perfect but when i add DrawIndexedPrimitive it gave me illegal software ?
present , reset , all working great ...
---------- Post added at 01:01 AM ---------- Previous post was at 12:30 AM ----------
Picture :
code :
Code:
pDrawIndexedPrimitive = (oDrawIndexedPrimitive) DetourFunction((PBYTE)vtbl[82] , (PBYTE)myDrawIndexedPrimitive);
DIP
Code:
HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseIndex,
UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
UINT Offset,iStride;
if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &iStride) == D3D_OK)
Stream_Data->Release();
if(fbright)
{
if(iStride==44)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255));
}
}
return pDrawIndexedPrimitive(pDevice, Type, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
Code:
typedef HRESULT (WINAPI* oDrawIndexedPrimitive)(pD3DdeviceX pDevice, D3DPRIMITIVETYPE PrimType,Integer BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);