Sign in to follow this  

DirectDraw overlays (again!)

This topic is 3851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know this is such a common subject, but I can assure you I have searched these forums relentlessly about this subject. I have got Muhammad's MDX example working by incorporating the YUY2 color space (yes I have an NVidia card). I do it a little bit different than what is recommended.. rather than converting the pixels I just use a blt call and that sorts out the conversion for me. So I now have an overlay on the screen. The first problem is that creating a primary surface will fail if there is already an application in exclusive mode. I did infact get around this problem by calling UpdateOverlay to itself instead of the primary surface. The problem is the overlay is behind the game not in front! I don't understand how these things are supposed to work. Don't most games have exclusive fullscreen mode? If they do, how can anyone expect overlays to work? Can they work if the target game is in exclusive mode? What games do work then?

Share this post


Link to post
Share on other sites
Create a primary surface before launching the game in question, just like the sample does. You can create it and keep it hidden until needed.

Quote:
I don't understand how these things are supposed to work. Don't most games have exclusive fullscreen mode? If they do, how can anyone expect overlays to work? Can they work if the target game is in exclusive mode? What games do work then?

In light of recent testing with DirectDrawOverlayLib, I'd say that it's not a universal solution--it's highly driver dependent (and with Vista, certain things just don't work for unknown reasons). I think that the robust, universal way to do overlaying is to use global IAT (Import Address Table) hooking to hook Direct3D/Draw/OpenGL. I think that's what XFire and Co use, but I'm not certain because I've not examined them in close detail yet. I had planned to explore global hooking after finishing the overlay library, but I've not been able to work on the library for a couple of weeks now.

Share this post


Link to post
Share on other sites
Muhammad -

Do you have any clue whether hooking is even possible from managed code? my existing code is all managed, and i don't have the c++ skills to do much on that end.

i've got most of the overlay lib working in pure managed code, but without color keying (which seems to be impossible on nvidia) it doesn't do me a lot of good. i know that Fraps uses the hooking technique to draw it's FPS display, so i'm hoping to find out more about going that route.

Share this post


Link to post
Share on other sites
Muhammad has posted example code in C++ for hooking Direct3D using APIHook, but I doubt porting it to managed code would be easy. You would probably need to re-write it into a dll and call it from your managed code that way.

Share this post


Link to post
Share on other sites

This topic is 3851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this