[C++] DirectDraw Overlay Library

Started by
14 comments, last by Headkaze 14 years ago
Advertisement
Muhammad Haggag
Author
1,358
April 24, 2007 01:46 PM
I have created a C++ overlay library based on the C++ Overlay Sample published almost a year and a half ago. It improves a number of things over the sample: 1. It works on nVidia cards, using either the YUY2 or UVYV surface formats. 2. It is packaged as a C++ library. A C++/CLI wrapper will be written as soon as I fix any outstanding issues with the native library. 3. A better sample is included, which shows how one can blit a window to the overlay. The project page can be found on Codeplex, here. Currently, the only available release is 0.5b, which includes 3 files: 1. DirectDrawOverlay-lib-0.5b.zip, the release and debug builds of the library. 2. DirectDrawOverlay-bin-0.5b.zip, the sample binary files. 3. DirectDrawOverlay-src-0.5b.zip, the source code (VS8 solution). Build instructions can be found at the project homepage. The sample Details on what the sample does can be found here. The YUV issue There's a known issue with YUV formats--i.e, on nVidia cards--where the colors for some controls are messed up. Most notably, black-text-on-white is shown in the overlay as white-text-on-black. It's on my TODO list, and it's probably some silly conversion error, so ignore this for now. I need your help I need people with pre-Vista systems to test the sample on any fullscreen games they have, both Direct3D and OpenGL ones. So far, the one XP tester I had has never reported failure. With Vista systems, the situation is rather strange. The 2 Vista testers I had reported that: 1. Fullscreen DirectX SDK samples work fine with the overlay. 2. Fullscreen Direct3D applications other than the samples cause the overlay to be lost. 3. Fullscreen OpenGL applications cause the overlay to be lost. It's not entirely clear what's going on with #2, perhaps it has to do with multisampling or some setting used by the games by default. No idea what's going on with #3, though. It's either related to the new Vista driver architecture, or a driver issue. Further testing should provide some clues. Please include your graphics card type and driver version with any error reports.

Muhammad Haggag
Author
1,358
April 25, 2007 06:41 AM
If you get an "Application configuration is incorrect" error on launching the sample, that means you don't have the updated VC++8 SP1 runtime DLLs. I have uploaded the runtime installer vcredist_x86.exe to the release.

jollyjeffers
April 25, 2007 08:38 AM
I don't have VC8-SP1, Boost or wxWidgets installed so I can't build anything [headshake]. I needed to install the VC8 SP1 runtimes before I could get the standalone binaries running...

My results:

  • Windows XP Professional 32bit
  • Nvidia GeForce 6800 512mb RAM. I updated to latest drivers a week or so back, but not sure which version.

    Running on the desktop - works as expected, but display is a bit fuzzy (almost like slightly off bilinear filtering) as well as muddy colours - their mostly correct, but the background of the textbox is light grey instead of white for example. If I drag the window off one edge of the display then I get a corresponding black area in the overlaid copy...

    Windowed and fullscreen mode D3D9 sample apps don't seem to make any difference - it keeps on trucking [smile]

    Fullscreen video via WMP (I understand some codecs use overlays?) is absolutely fine as well.

    Running a couple of non-SDK tech demo's wasn't quite so successful:

    The ancient 'The Project' demo from ATI/CryTek managed to hide the overlay.

    The 'Illuminatu' demo (another old one, forget where from) worked okay - overlay appeared as expected.

    Couldn't find any other samples worth running - most of mine are based on the DXUT/SDK framework and my Anti-Virus software removes any OpenGL code from my system [wink]

    Jack
  • <hr align="left" width="25%" />
    Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

    Muhammad Haggag
    Author
    1,358
    April 25, 2007 10:08 AM
    Quote:Original post by jollyjeffers
    I don't have VC8-SP1, Boost or wxWidgets installed so I can't build anything [headshake].

    Indeed, this is a bit of an issue. There's no way to work around this with wxWidgets, since it's a huge dependency, but I'll look into incorporating the headers I use from boost into the source tree.

    Quote:Running on the desktop - works as expected, but display is a bit fuzzy (almost like slightly off bilinear filtering) as well as muddy colours - their mostly correct, but the background of the textbox is light grey instead of white for example.

    This is due to the RGB<->YUV conversion. I'm not doing it 100% right, it seems. I have to do some analysis on my code to see why the colors are inverted at places.

    Quote:Fullscreen video via WMP (I understand some codecs use overlays?) is absolutely fine as well.

    I don't think modern codecs use DirectDraw overlays anymore, but I could be wrong. Either way, glad it's working.

    Quote:The ancient 'The Project' demo from ATI/CryTek managed to hide the overlay.

    Is that a D3D9 demo? Incidentally, does it take a relatively long time to "activate" fullscreen operation? I have no idea what's going on, but the fullscreen applications that don't work seem to take a long time to enter fullscreen, while the samples are almost instantaneous.

    Quote:Couldn't find any other samples worth running - most of mine are based on the DXUT/SDK framework and my Anti-Virus software removes any OpenGL code from my system [wink]

    Umm..don't you have any games MR UBER GEEK? :P

    Thanks a lot for the tests, much appreciated [smile].

    Muhammad Haggag
    Author
    1,358
    April 25, 2007 12:15 PM
    Does the demo, "The Project", have multi-sampling enabled? I just tested with one of the SDK samples. The overlay disappears if I tell the sample to go fullscreen with multi-sampling.

    jollyjeffers
    April 25, 2007 05:32 PM
    quick reply as it's past my bedtime...

    Quote:Does the demo, "The Project", have multi-sampling enabled?
    I think it does, but I don't have time to double-check it now as it takes several months to load [rolleyes].

    Quote:Umm..don't you have any games MR UBER GEEK?
    Games? What, you think I can waste time on such things when there are forum posts to be replied to...?!

    Only games I'm playing are on Windows Vista at the moment - C&C3 won't run on Windows XP.

    Jack

    <hr align="left" width="25%" />
    Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

    circlesoft
    April 25, 2007 06:55 PM
    Well look who it is!

    Quote:There's no way to work around this with wxWidgets, since it's a huge dependency, but I'll look into incorporating the headers I use from boost into the source tree.

    Or you could reundisincorporate them back out of the source tree and use something worthwhile [wink]

    Anyhow, I still have an XP system so I'll test soon. You wouldn't believe how many people come around looking for this overlay stuff.
    Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
    Muhammad Haggag
    Author
    1,358
    April 25, 2007 11:13 PM
    Quote:Original post by circlesoft
    Quote:There's no way to work around this with wxWidgets, since it's a huge dependency, but I'll look into incorporating the headers I use from boost into the source tree.

    Or you could reundisincorporate them back out of the source tree and use something worthwhile [wink]

    Go back to your C with classes, heathen. I'll keep my C++ [wink]

    Quote:Anyhow, I still have an XP system so I'll test soon. You wouldn't believe how many people come around looking for this overlay stuff.

    If you have no results to show, why are you posting in the first place? Remember, I know where you live. So get on with it.

    aeoth
    April 29, 2007 07:12 AM
    Quote:It's not entirely clear what's going on with #2, perhaps it has to do with multisampling or some setting used by the games by default.


    Windows Vista, NVIDIA 7900GT

    DX9
    In World of Warcraft, changing multisampling to 1x (or, I guess, off), made it display. Any other value, and yup, the overlay was hidden.

    In Lord of the Rings Online, it worked fine, although I couldn't see a specific multisampling setting.

    In C&C3 I couldn't get the overlay to show at all

    WMP worked fine.

    OpenGL
    Well, I really only had one to test...Frets on Fire.
    Confirming your third point, the overlay was hidden.

    I'd seen your C++/C# samples late last year, but I've only gotten around to looking into it today.
    Talk about great timing... ;)

    I suppose the 'worst' problem with this, from a Vista users point of view, is the disabling of Aero once the overlay is initalised (and isn't restored until the sample program is closed)

    I don't know if this can be 'fixed', or if really matters too much.
    You can probably just fire DwmEnableComposition() from DWMAPI.DLL, or something along those lines (And I guess check if it was enabled in the first place, using DwmIsCompositionEnabled()), inside any application using this.
    Muhammad Haggag
    Author
    1,358
    April 29, 2007 09:58 AM
    Thanks for the report.

    Quote:Original post by aeoth
    DX9
    In World of Warcraft, changing multisampling to 1x (or, I guess, off), made it display. Any other value, and yup, the overlay was hidden.

    In Lord of the Rings Online, it worked fine, although I couldn't see a specific multisampling setting.

    In C&C3 I couldn't get the overlay to show at all

    WMP worked fine.

    Yes, it seems to be a problem with multi-sampling on Vista. An XP tester reported that the overlay worked for him even with multisampling.

    Quote:OpenGL
    Well, I really only had one to test...Frets on Fire.
    Confirming your third point, the overlay was hidden.

    Yeah, seems like another Vista issue.

    Quote:I suppose the 'worst' problem with this, from a Vista users point of view, is the disabling of Aero once the overlay is initalised (and isn't restored until the sample program is closed)

    I don't know if this can be 'fixed', or if really matters too much.
    You can probably just fire DwmEnableComposition() from DWMAPI.DLL, or something along those lines (And I guess check if it was enabled in the first place, using DwmIsCompositionEnabled()), inside any application using this.

    Well, that's what I do--I check if composition is enabled, and if it is, I disable it when the overlay manager is created. Turning off composition turns off Aero.

    Share:

    This topic is closed to new replies.

    Advertisement