views:

449

answers:

2

It looks like this question has been asked multiple times each in a different context and I have made some strides in making an overlay for a game (This is for informational data, etc..). I Would also like to make it inter-actable like Steam and XFire.

I have managed to get an overlay for a directx game while its in window mode... kinda.

I have looked all over stack overflow and google without a lot of luck.

If required, I can try this in C++ instead of C#. I know C# but I don't consider myself to be a professional by any means. Just need a better explanation. Heck I will be willing to put together a nice screencast/tutorial if I can get this working right.

NOTE : I would really like to do this with native code rather than a library but if there is a good free library out there, I would like to check it out.

Examples : http://stackoverflow.com/questions/3266346/how-to-overlay-graphcis-on-windows-games

http://www.gamedev.net/community/forums/topic.asp?topic%5Fid=359794

http://stackoverflow.com/questions/1442303/c-lock-an-overlay-form-to-the-position-of-another-window

More Info : I did manage to get a windows form to overlay a game window with and set its parent to that with SetParent. This however, does not work very well because it will not work in fullscreen at all and the transparency didn't work. (basically had a transparency key and the TopMost was set to TRUE.) I would really like to find a different method.

A: 

I suggest using the RenderToSurface Method of the DirectShow Library. It has pretty much everything your looking for. (DirectX Surface Drawing).

http://www.experts-exchange.com/Programming/Game_Development/Game_Graphics/DirectX/Q_20410452.html (One Example)

http://www.google.com/url?sa=t&source=web&cd=8&ved=0CDIQFjAH&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Fmagazine%2Fcc164112.aspx&rct=j&q=Directx%20Surface%20drawing&ei=ce13TM7XMo-lnQeDyamdCw&usg=AFQjCNHTn2915PTvL-CB7X_c1J0Cov8Vpw&cad=rja

Joe Garrett
Thanks, I am checking this out.
Tyler
Your first link is broken. It's a subscription page which as far as I can tell has little to do with the answer.
aib
Then how would you know whether it has anything to do with the request - considering the original question it seems you are commenting arbitrarily based upon an assumption. Experts Exchange, is a paid answer/solution service for developers and programmers. Excerpt: How to access a thread's (program's) (secondary) surfaces from another thread (program).I think the DirectX surface capturing is a well kept secret. /at least i could not find ANY info on the topic/
Joe Garrett
I appreciate the comments. I am still trying to find a decent solution. Also, yes... it seems anyone who has figured out a good way of doing this has kept it a secret.
Tyler
@Joe Garrett: Yea, sorry about that. Don't know why I gave such a big reaction. Must have to do with seeing that EE ad again. (I used to be a member.)
aib
@aib - Note that if you are using a modern browser - just scroll to the bottom of the page for any answer on ee.
Joe Garrett
@TYLER - I would look into the teamspeak forums (they have an old product teamspeak overlay) that did this for any directX enabled game.
Joe Garrett
+1  A: 

http://www.gamedev.net/community/forums/topic.asp?topic_id=445141

I actually tried that, it freezes and crashes in Vista and Win7. Thanks, though.
Tyler