Drawing on another apps screen
I am trying to make an add on program for games that I play, and here''s my current method of drawing on the games screen.
HWND window = FindWindow(...);
HDC gamedc = GetDC(window);
Then I use basic GDI functions like TextOut to draw on the screen. It works, but it cuts my frames per seconds in half and it''s horribly flickery. Any ideas on how to make this work better? Is there anything in OpenGL that I could use to make things go more smoothly? Thanks for any help you can offer.
May 17, 2001 05:17 PM
Try directdraw. I don''t know if it will work in your case but you might as well give it a try.
GDI is way too slow for games.
GDI is way too slow for games.
May 17, 2001 05:18 PM
DONT EVEN TRY IT... OpenGL renders one frame at a time. Which means, if you try using it, the window WILL be cleared before your stuff appears.. (i.e. you have to overwrite the entire window)... If thats what you want to do, then try getting the rendercontext from the device context.
May 17, 2001 05:19 PM
DONT EVEN TRY IT... OpenGL renders one frame at a time. Which means, if you try using it, the window WILL be cleared before your stuff appears.. (i.e. you have to overwrite the entire window)... If thats what you want to do, then try getting the rendercontext from the device context.
Hmmm...
There has to be some good way of doing it, because I''ve seen a program that draws a custom crosshair on the screen and doesn''t seem to affect the frame rate and has no flickering. I thought maybe that it edited some kind of bitmap or something within the game, so that the game rendered it, but you can turn the custom crosshair on and off, so he''s obviously drawing it on the screen, right?
There has to be some good way of doing it, because I''ve seen a program that draws a custom crosshair on the screen and doesn''t seem to affect the frame rate and has no flickering. I thought maybe that it edited some kind of bitmap or something within the game, so that the game rendered it, but you can turn the custom crosshair on and off, so he''s obviously drawing it on the screen, right?
Don't quote me on this, as I'm no expert, but I'm guessing the reason that it's so flickery and the framerate is so low is that the cycles of your program and the other's are out of sync (as opposed to they draw, then you immediately draw, it might be they draw, they calculate the next frame, then you draw, but they immediately clear afterward, so your addition's only displayed for a part of the frame...not sure if I'm making sense, but you get the idea).
Another way to do it would be just to make a transparent window with the same dimensions as the target window, with no border or anything, and just draw to your own window...
Yet another way would be to see if the game has some kind of HUD overlay bitmap and just edit that (get a resource editor if that's where it's stored), but I don't know if that would work for whatever games you're working with, nor if what you're attempting to accomplish is a dynamic effect, in which case this would be useless.
And yes, it would be useless to try and use OpenGL for something like that =o)
Edited by - cliffhawkens on May 17, 2001 6:46:39 PM
Another way to do it would be just to make a transparent window with the same dimensions as the target window, with no border or anything, and just draw to your own window...
Yet another way would be to see if the game has some kind of HUD overlay bitmap and just edit that (get a resource editor if that's where it's stored), but I don't know if that would work for whatever games you're working with, nor if what you're attempting to accomplish is a dynamic effect, in which case this would be useless.
And yes, it would be useless to try and use OpenGL for something like that =o)
Edited by - cliffhawkens on May 17, 2001 6:46:39 PM
[email=erydo@gdnmail.net" style="color: #ff0000; text-decoration:none; cursor:help;](o= erydo =o)[/email]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement