Well ive been reading a book on D3D for a couple weeks now and i wanted to share some stuff i learned with you!
Well to start off this is my code for soldierfront but can easily be used for Combat Arms.
My wireFrame this is a simple effect i will go over the what it means in depth:
Code:
typedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
oDrawIndexedPrimitive pDrawIndexedPrimitive, OriginalDrawIndexedPrimitive;
HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
{
if(WireFame)
if(m_Stride == 40)// have to change this!
{
pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
}
Basically the top is just my call to D3D, here i make a call to DrawIndexedPrimitive wich just renders the vertices basically.
Code:
pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
this is where i make the screen only show the wires the game is based off of.
pDevice - this is our device pointer
SetRenderState - is where i assign my values to a render state..
i dont want to go to in depth because i want to move on to my favorite part!!
Here is my code for fullbright.. it is very simple all u do is color in the ambient colors to the max wich will make everything brighter ( if u want darker just make everything 50)
Code:
{
if(fullbright)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false); //direct3d lighting off
pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255)); // use all colors for best effect
}
Now we move on to No Fog, another D3D effect
Code:
if(nofog)
{
pDevice->SetRenderState(D3DRS_FOGENABLE, false);
}
Now for the wallhack i wont explain this one because its pretty self explainator if you know what your doing!
Code:
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
pDrawIndexedPrimitive(pDevice, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
As you can their are no chams set becuz i am just showing you how to set it to see through walls..
also i wouldnt give you these without telling you how to set hotkeys of Course just replace this code with the button, and hack you want this to turn on.
Code:
if (GetAsyncKeyState(VK_F1)&1) // if we press F1
{
nofog = !nofog; //no fog turns on
}
now last my favorite (: asus wallhack:
Code:
{
if(AsusWallhack)
if(Model_rec) // this is so we will edit the walls nothing else
{
pDevice->SetRenderState( D3DRS_SRCBLEND, 3 );
pDevice->SetRenderState( D3DRS_DESTBLEND, 4 );
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
}
}
Basically this isnt a full tutorial becuase i dont want to spoon feed anything to noobs but if you know what you are doing you will be able to include these D3D functions in your hacks !