views:

64

answers:

2

What little information I managed to dig out on developing in-game overlays (similar to what Steam does) mentions having to intercept calls graphics API's frame swapping function, and hook my own drawing routine in it.

This appears to be what Mumble (a gaming VoIP) is doing. Since I've never done anything that involves hooking, and since I don't really have much experience with DirectX, I'm wondering if there is some sort of SDK, or even just a more readable example than Mumble that also implements input, that demonstrates how to implement an interactive in-game overlay. Mumble is great, but I don't seem to be able to wrap my head around it, especially around the more interesting things it does in order to hook its stuff properly.

Also, if you have more detailed info on how to do this on Mac and Linux... :-)

+1  A: 
  • Start by designing your overlay without intercepting graphics API. Keep in mind that the key input must use global hooks.
  • Integrate it to the application using a Direct3D interceptor dll. Google it to retrieve a base code.

Edit:

tibur
Care to share a specific link? "Direct3D interceptor dll" does not return any sensible results via Google.
Ivan Vučica
Proxy/interceptor DLLs placed in app's folder are not what I'm looking for, since I'd like to be able to affect any game launched on the machine. Looks like this question might contain the answer I'm looking for: http://stackoverflow.com/questions/1994676/hooking-directx-endscene-from-an-injected-dll
Ivan Vučica
+1  A: 

Maybe GLIntercept could give you some inspiration. It provides an openGL.dll file that you put in your app's folder. Windows loads this dll instead of system32's one because of priority rules. GLIntercept forwards all calls to the system32's dll, but logs them all meanwhile. So, you could implement your own glSwapBuffers() which renders some more things, and then forwards the call.

Source code is available as well.

I upvote your question, and I'm interested in you future discoveries... feel free to repost when you have more info :)

Calvin1602
Thanks :-) Unfortunately, GLintercept (and equivalent methods for DX) as you describe them are not what I'm looking for; I would like to inject the functions into any game that launches. That said, it looks like this related question (as suggested by StackOverflow): http://stackoverflow.com/questions/1994676/hooking-directx-endscene-from-an-injected-dll seems to contain the answer.
Ivan Vučica