Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Creating an overlay


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 d07RiV   Members   -  Reputation: 116

Like
0Likes
Like

Posted 20 January 2014 - 09:15 AM

I know there is a way to create an overlay surface with DirectDraw, but that API is outdated and is not even present in the newer SDKs. Does it still work with Win7+?

What is the modern way of doing that? I've seen IDirect3DDevice9Ex support for hardware overlays, but it seems to be indended for video rendering and I'm not sure it would work (I need to render over any window, including fullscreen games). Besides, it wouldn't work with older Windows.

Also, do any of these methods support alpha blending (not color key)?

 

There's also a possibility to hook Direct3D to add rendering code to EndScene, but that would limit me to rendering inside an application window, and I would also have to hook other APIs such as D3D11 and OpenGL.



Sponsor:

#2 d07RiV   Members   -  Reputation: 116

Like
0Likes
Like

Posted 20 January 2014 - 12:16 PM

Okay, DirectDraw overlays don't work with DWM, which is unacceptable for me.

Tried the Direct3DEx, I'm getting "Overlay is not supported" on my machine when creating the device with D3DSWAPEFFECT_OVERLAY (Win7, 550Ti graphics card; does SDK version matter?).

Any alternatives? Is api hooking really the only way?

 

Update: figured I'd stick with hooking, its working so far, but I have a couple questions. I'm getting the address of IDirect3DDevice9::EndScene and adding a detour (using a small library) to call my rendering code, that creates a texture from a memory-mapped file and renders it in a certain area (which involves modifying a lot of render states, still not sure if I got them all).

First, how can games react to such intrusion? Since a lot of them have anti-hack measures, what can I expect? How do other programs (including Fraps) deal with this?

Second, I got it to successfully remove the hook when the launcher is closed, without crashing the target app. However, testing it on SDK samples, if I close the target program first, it shows a warning along the lines of "D3D state has non-zero reference count blah blah blah" and the sample process doesn't terminate, even after the launcher is closed, so I have to kill it in task manager. How am I supposed to detect and handle this?


Edited by d07RiV, 21 January 2014 - 03:39 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS