DirectDraw Overlays on Vista: DDERR_OUTOFCAPS

My DirectDraw Overlay Sample does not work on Windows Vista. It fails at the call to IDirectDraw7::UpdateOverlay, with the HRESULT DDERR_OUTOFCAPS. If you search online for that, you won’t find any meaningful results–only the explanation that this error occurs when the overlay capabilities are already maxed, i.e. the DDCAPS::dwMaxVisibleOverlays cap has already been surpassed.

In examining the issue, I noticed that AngelCode’s overlay sample works fine. After examining his code, the only difference in our initialization sequences is that he retrieves the device context–HDC–on the primary surface before showing the overlay. He does that because he draws manually to the overlay, and he uses GDI to figure out the format of the surface.

So, it turns out, the solution was to simply retrieve the device context on the primary surface and immediately release it before calling IDirectDraw7::UpdateOverlay.

With that problem out of the way, I’m now working on transforming my sample into a flexible, robust overlay library.

About these ads

2 Comments »

  1. […] am · Filed under DirectDraw, Overlays, DirectX, Vista, Programming I discovered that the overlay problem I reported earlier was caused by the Desktop Window Manager, which is responsible for compositing […]

  2. […] discovered that the overlay problem I reported earlier was caused by the Desktop Window Manager, which is responsible for compositing […]

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: