Results 1 to 8 of 8
  1. #1
    PashaAmd's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    1,008
    Reputation
    58
    Thanks
    224

    [Help] D3D9 CrossHairs

    Hi I made some d3d9 crosshairs using the d3d9 starter kit 3.0 and I built it and everything is fine then when i go in-game and try to turn it on nothing happens then it crashes?
    Code:
    HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
    {
    	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);
    		}
    	if(GetAsyncKeyState(VK_NUMPAD0) & 1)
    		{
    			crosshair = !crosshair;
    		}
    	return m_pD3Ddev->EndScene();
    }
    then in globals

    Code:
    float ScreenCenterX = 0.0f;
    float ScreenCenterY = 0.0f;
    bool crosshair = false;
    D3DCOLOR color = D3DCOLOR_XRGB( 200, 0, 0 );

  2. #2
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,409
    My Mood
    In Love
    Try use the xHair function from my base. Easy to use and do + it's already predone for you

    Oh btw.
    Code:
    globals:
    #define Color D3DCOLORshothere
    Last edited by flameswor10; 03-16-2011 at 04:28 AM.

  3. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    @PashaAmd Moved to C++ section, these guys can help alot.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  4. #4
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Hmm, clearing a certain area of the screen to draw a crosshair. o_O

    Everything looks right to me. It's probably the 'hack' part of your code that isn't working.

  5. #5
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    try to use a SetPixel function instead...

  6. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    If you're still unable to get it to work give D3DXLINE a try, they're quite easy to use. Look for examples on google.
    Ah we-a blaze the fyah, make it bun dem!

  7. #7
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    Quote Originally Posted by Play&Win View Post
    try to use a SetPixel function instead...
    SetPixel isn't good for many reasons....
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  8. #8
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by master131 View Post
    SetPixel isn't good for many reasons....
    but it's easier to make it working, than spending time to find the device pointer, and hook the endscene....