dcsimg
Results 1 to 17 of 17

Thread: Superimpose an image over a fullscreen game.

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Superimpose an image over a fullscreen game.

    How can I draw an image made by my VB6 program on top of a running fullscreen game?
    I tried bitblt but that is flickering too much.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    You can't.

    Unless you have a pointer to the DirectX/OpenGL surface.. its impossible.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    it's flickering because you are drawing onto one of the buffers in the game and it has multiple buffers so your drawing will only appear whenever that buffer is in front. There's nothing you can do about it. Even setting z-order won't help because a full-screen program in directx has exclusive access to video memory so your form wouldn't ever be drawn.

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    Quote Originally Posted by Lord Orwell
    it's flickering because you are drawing onto one of the buffers in the game and it has multiple buffers so your drawing will only appear whenever that buffer is in front. There's nothing you can do about it. Even setting z-order won't help because a full-screen program in directx has exclusive access to video memory so your form wouldn't ever be drawn.
    What he is doing is directly blitting an image to the desktop device context.. which is constantly overwritten by the DirectX/OpenGL buffer..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5
    Hyperactive Member metalmidget's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    342

    Re: Superimpose an image over a fullscreen game.

    What's with the flood of people asking how to put text/graphics over the top of a 'proper' game lately? I think I'll write a tutorial on how to do it. I will read something like:
    "You can't.

    Unless you have a pointer to the DirectX/OpenGL surface.. its impossible."

    plagiarism ftw

    metal

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    LOL.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    Quote Originally Posted by chemicalNova
    What he is doing is directly blitting an image to the desktop device context.. which is constantly overwritten by the DirectX/OpenGL buffer..

    chem
    that's exactly right, but if the fullscreen game is drawing directly on the desktop instead of creating it's own window, and it uses the .swap function of the surface, anything drawn on the desktop while it's cycling will be preserved and placed on the buffer.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Superimpose an image over a fullscreen game.

    So how would I find out what the pointer to the DirectX/OpenGL surface is?

  9. #9
    Hyperactive Member metalmidget's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    342

    Re: Superimpose an image over a fullscreen game.

    I doubt it's something you'll be able to accomplish. Dont take that as an insult- Even if you could access the pointer, you'd then need to know how to use it properly. You'd have to have a working knowledge of the code of the game you're trying to do this for. Plus there are no pointers in VB6 so I'm not sure how you'd store the address of a surface and then blit to it. Probably using an hDC. I hate to say it, but this might be one for the too hard basket...

    sorry
    metal

  10. #10
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    Quote Originally Posted by jeroen79
    So how would I find out what the pointer to the DirectX/OpenGL surface is?
    i know this is going to annoy you to learn this, but device contexts are used by gdi32 but NOT used by directx. Unless they purposefully code one into the program, there isn't one there by default.

  11. #11
    Hyperactive Member metalmidget's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    342

    Re: Superimpose an image over a fullscreen game.

    To translate- are you saying that it's 99% certain that even if you can find the pointer used by the game, you'd still be no closer to a solution because it won't be compatible with the functions used by VB6 and WinAPIs?

    metal

  12. #12
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    no what i am saying is that it probably doesn't have a pointer to find.

  13. #13
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    It is possible to do what is required.. once you do have a pointer to the surface, you use it in your own DirectX or OpenGL APIs..

    But again.. the address in memory of where the surface starts.. would be extremely hard to find.

    Quote Originally Posted by Lord Orwell
    no what i am saying is that it probably doesn't have a pointer to find.
    Not really.. in the switch to C++.. you could do something like this:
    Code:
    DirectX8Surface * pointer2Surface = GetSurface();
    
    DirectX8Surface * GetSurface()
    {
        // find the surface here
        return &surfaceAddress; // & (AddressOf)
    }
    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  14. #14
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    isn't that assuming it's your surface? Of course you can get your own surface.

  15. #15
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    Nah.. theres ways to find the other applications surface. My example above does seem a bit confusing, having not completed it properly

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  16. #16
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,577

    Re: Superimpose an image over a fullscreen game.

    well i am by no means an expert of dx9 but i know for a fact that if you are programming in 7 or 8, you have to program it to have a gdi interface (give it a hdc) if you want to interface with other programs.

  17. #17
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Superimpose an image over a fullscreen game.

    Quote Originally Posted by Lord Orwell
    well i am by no means an expert of dx9 but i know for a fact that if you are programming in 7 or 8, you have to program it to have a gdi interface (give it a hdc) if you want to interface with other programs.
    Not all wallhack-type cheats, and maphack-type cheats, work by changing the render-states on a global scale. Some are local to the game window.. hence the term "hooking" when creating cheats. You can still receive events from a render device of another window.. and with that, you get a pointer to it. I'm no expert with DirectX at all (I'm on OpenGL person myself), but if you need to have a device context aswell.. those are even easier to find..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width