Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Directx9 question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Oct 20, 2007 1:53 pm    Post subject: Directx9 question Reply with quote

source attached // program attached

Code:
void render_frame(void)
{

    HRESULT hr;
    static BYTE keystate[256];    // create a static storage for the key-states
    hr=dinkeyboard->Acquire();
    while( hr == DIERR_INPUTLOST )
    {
       hr = dinkeyboard->Acquire();
    }
    dinkeyboard->GetDeviceState(256, (LPVOID)keystate);
    d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
    d3ddev->BeginScene();
    d3dspt->Begin(NULL);
    d3dspt->Draw(sprite, NULL, &center, &position, D3DCOLOR_XRGB(255, 255, 255));
    d3dspt->End();

    d3dsptf->Begin(D3DXSPRITE_ALPHABLEND);
    d3dsptf->Draw(spritef, NULL, &center, &position, D3DCOLOR_ARGB(0, 255, 255, 255));
    if(keystate[DIK_RIGHT] & 0x80)
{
   d3dsptf->Draw(spritef, NULL, &center, &position2, D3DCOLOR_ARGB(0,255,255,255));

}
    d3dsptf->End();
   
    d3ddev->EndScene();    // ends the 3D scene
    d3ddev->Present(NULL, NULL, NULL, NULL);

    return;
}


Ok i use directinput to detect when right arrow was pressed. If its pressed then the new sprite renders in beside the old one. It works

but when i let go of the key, it disappears.

Any ideas/links/source?



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Sat Oct 20, 2007 2:59 pm    Post subject: Reply with quote

Its doing exactly what youre telling it to do.
While the button is pressed to render your sprite.

and no need to use brackets there
Code:
if ( a == b )
    then_do_this_fucntion()

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ZenX
Grandmaster Cheater Supreme
Reputation: 1

Joined: 26 May 2007
Posts: 1021
Location: ">>Pointer<<" : Address 00400560 Offset :1FE

PostPosted: Sat Oct 20, 2007 4:52 pm    Post subject: Reply with quote

dx39.Dll can not be found is what i get.
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine
Back to top
View user's profile Send private message Yahoo Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Oct 20, 2007 5:52 pm    Post subject: Reply with quote

Try to loop the function that changes the render?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Oct 20, 2007 6:19 pm    Post subject: Reply with quote

solution found

instead of redrawing the sprites on the right arrow i change the vector and the next time it redraws it will use the new vector

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites