| View previous topic :: View next topic |
| Author |
Message |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Jan 28, 2009 2:28 pm Post subject: [C++] Drawing over maple/gunbound |
|
|
Ok my problem is that the screen keeps updating, and it lags to use a while statement.... is there anyway to keep the line ON top?
im using..
HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
I know it gets the display but i have nothing better to use...
_________________
|
|
| Back to top |
|
 |
FerrisBuellerYourMyHero Master Cheater
Reputation: 0
Joined: 14 Feb 2007 Posts: 401 Location: Inside your <kernel>
|
Posted: Wed Jan 28, 2009 2:45 pm Post subject: |
|
|
See the problem is that the game draws right over it, then you draw over the game, the game draws back over it, etc, etc..
It creates a flickering effect which looks bad!
The only way to prevent the flicker is to hook the games drawing loop, as in a directx hook. But then if your hooking directx you might as well use directx to draw what you want to draw!
In this way your forcing the game's drawing loop to draw your drawing, which makes it look like its part of the game and their is absolutely no flicker! Draw in EndScene right before calling the real EndScene. Because whatever is drawn last will be on top of everything else, which is what you want.
_________________
You know, life moves pretty fast. If you don't stop and look around once in a while, You could miss it!
 |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Jan 28, 2009 3:37 pm Post subject: |
|
|
As you might have noticed, im using C++...
so do you know any way to do this with C++ and if u do
can u show me an example?
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Jan 28, 2009 3:44 pm Post subject: |
|
|
| If you want to draw over it with GDI, find a good place in the render loop to jump to your drawing routine, and do it there. You shouldn't get flickering.
|
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Jan 28, 2009 3:46 pm Post subject: |
|
|
| slovach wrote: | | If you want to draw over it with GDI, find a good place in the render loop to jump to your drawing routine, and do it there. You shouldn't get flickering. |
What's a render loop? and post an example plz. I can't do anything without seeing it first. thats just me >.>
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Jan 28, 2009 4:14 pm Post subject: |
|
|
The render loop is the loop that draw's all the games graphics... Where it draw's all its frames, sprites, etc.
And no one will post an example since you asked for 2 specific games.
Learn yourself.
_________________
|
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Jan 28, 2009 4:16 pm Post subject: |
|
|
... i meant like a tut.... nvm
_________________
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Wed Jan 28, 2009 5:38 pm Post subject: |
|
|
alternitivly you could Window the game into another window and not allow it to draw to the whole window..
i can give u the keys.. you must open the door..
regards BanMe
p.s. the keys are SetWindowParent() SetWindowLong() .. i wrote a utility in autoit back when Survival Project was around called Banimizer that did just this.. search the autoit forums for MSCPorts..
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed Jan 28, 2009 6:20 pm Post subject: |
|
|
| Hooking Direct3D Creates the best performance. The others create laggy crap. I made one using win gdi32 and it flickers... So hook D3D.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Jan 28, 2009 7:02 pm Post subject: |
|
|
| dnsi0 wrote: | | Hooking Direct3D Creates the best performance. The others create laggy crap. I made one using win gdi32 and it flickers... So hook D3D. |
Refer to my post above.
I did that in COD4 some time ago, it worked fine, and there was essentially no flickering.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed Jan 28, 2009 7:11 pm Post subject: |
|
|
| slovach wrote: | | dnsi0 wrote: | | Hooking Direct3D Creates the best performance. The others create laggy crap. I made one using win gdi32 and it flickers... So hook D3D. |
Refer to my post above.
I did that in COD4 some time ago, it worked fine, and there was essentially no flickering. |
Then I must have made something wrong with my code...
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Wed Jan 28, 2009 9:19 pm Post subject: |
|
|
if you are on a MP system like i am you can assign threads to CPU's thus avoiding flickering..
regards BanMe..
|
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Thu Jan 29, 2009 4:41 pm Post subject: |
|
|
New Question: How do i sense a click? o.O
_________________
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Thu Jan 29, 2009 6:08 pm Post subject: |
|
|
| Quote: | | GetAsyncKeyState() |
Alternatively you can hook the WndProc.
_________________
|
|
| Back to top |
|
 |
|