allen434343

Untitled

Jul 22nd, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. include <windows.h>
  2. #include <D3DX9.h>
  3. #include "Function.h"
  4. #include "systeminclude.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. D3DVIEWPORT9 cViewport;
  9.  
  10. int Crosshair;
  11.  
  12. float ScreenCenterX = 0.0f;
  13. float ScreenCenterY = 0.0f;
  14.  
  15.  
  16.  
  17. #define GREEN D3DCOLOR_ARGB(255, 000, 255, 000)
  18. #define crosshair 0
  19. #define PI 3.14159265//Defining what PI is. PI is a Circle
  20.  
  21.  
  22. LPDIRECT3DDEVICE9 pDevice;
  23. ID3DXLine *pLine;
  24.  
  25. D3DCOLOR Red = D3DCOLOR_ARGB(255, 255, 0, 0);
  26.  
  27. HRESULT WINAPI hkEndScene (LPDIRECT3DDEVICE9 pDevice)
  28. {
  29. pDevice->GetViewport(&cViewport);
  30. ScreenCenterX = (float)cViewport.Width / 2;
  31. ScreenCenterY = (float)cViewport.Height / 2;
  32.  
  33. if ( Crosshair )
  34. {
  35. D3DRECT Rect1 = {ScreenCenterX-10, ScreenCenterY, ScreenCenterX+8, ScreenCenterY+1};
  36. D3DRECT Rect2 = {ScreenCenterX, ScreenCenterY-8, ScreenCenterX+1, ScreenCenterY+8};
  37. pDevice->Clear(1, &Rect1, D3DCLEAR_TARGET, Red, 0, 0);
  38. pDevice->Clear(1, &Rect2, D3DCLEAR_TARGET, Red, 0, 0);
  39. }
  40.  
  41. if ( GetAsyncKeyState( VK_INSERT ) &1 )
  42. {
  43. Crosshair = !Crosshair;
  44. }
  45. return hkEndScene(pDevice);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment