- Microsoft Visual C++ 6
- DirectX 9.0 SDK Update - (Summer 2004)
- D3D Starter Kit 3B Download
you can now setup C++ to use the SDK lib files.
Ok so, open up C++ 6
To to tools>options>Directories
Then on the right select choose Show directories for Include files
Add the Microsoft Directx 9.0 SDK include folder
Then it should look like this:
After you have done that, on the left again choose
Show directories for Lib files and choose the
Microsoft Directx 9.0 SDK lib folder.
Now press ok!
Your done setting up C++ 6!
Now we must setup the starter kit so we can use it!
Extract the files in the Starter kit, and go into the D3D9 folder.
It should look like this:
Now go into the old_workspace folder, and copy the 2 files into the D3D9 folder.
After that, go in C++ 6 and click file>open workspace
and open TatniumD3D.dsw
Once you have done those you can make a hack! Yeay!
I will now show you how to draw a crosshair
Put this in globals: (right under "#define D3DHOOK_TEXTURES")
Code:
float ScreenCenterX = 0.0f;
float ScreenCenterY = 0.0f;
bool crosshair = false;
D3DCOLOR color = D3DCOLOR_XRGB( 200, 0, 0 ); // Add your own values if you want....
Now press Ctrl + F and search for SetViewport
Under
HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9 *pViewport)
{
Put:
ScreenCenterX = ( float )pViewport->Width / 2;
ScreenCenterY = ( float )pViewport->Height / 2;
So now it will look like this:
HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9 *pViewport)
{
ScreenCenterX = ( float )pViewport->Width / 2;
ScreenCenterY = ( float )pViewport->Height / 2;
return m_pD3Ddev->SetViewport(pViewport);
}
Now Press Ctrl + F again and search for EndScene
Put:
if(crosshair)
{
D3DRECT rec2 = {ScreenCenterX-20, ScreenCenterY, ScreenCenterX+ 20, ScreenCenterY+2};
D3DRECT rec3 = {ScreenCenterX, ScreenCenterY-20, ScreenCenterX+ 2,ScreenCenterY+20};
m_pD3Ddev->Clear(1, &rec2, D3DCLEAR_TARGET,color, 0, 0);
m_pD3Ddev->Clear(1, &rec3, D3DCLEAR_TARGET,color, 0, 0);
}
In EndScene
Now its time for hotkeys!
I'ma now show how to do menus cause their confusing :S
Now you can put hotkeys in either beginscene or endscene!
They both work :D
A hotkey will look like this:
if( GetAsyncKeyState(hotkeyhere) & 1 )
{
commandgosehere = !commandgosehere;
}
But it this case we want it like this:
if( GetAsyncKeyState( VK_Insert ) & 1 )
{
crosshair = !crosshair;
}
The hotkey will be insert!
Now build it then batch build it!
And then your done!
Take the dll you build and inject it to a D3D9 game!
Post a Comment