C++/Windows desktop: What replaced Direct Draw? Documentation on Microsoft is horrible

Started by
4 comments, last by MJP 3 years, 11 months ago

Thinking of resurrecting an old project of mine, I previously used DirectDraw, and used a CImage class I found to do Blt the image to video memory, etc. The primitives I used were basic GDI calls: CreatePen, SetTextColor, FillRect, DrawText, MovetoEx, LineTo, etc.

Installed VS 2019, gamedev support.

I can't figure out how to get problems with my old code (DirectDrawEnumerateEx) so I'm trying to figure out what I should be using these days. I still want to use GDI if possible. It's a moving map GPS display, so was using Blt for smooth animation.

It looks Direct3D 11 is a choice but it looks like a nightmare overkill for my simple 2D GDI painting. Looks like GDI was replaced with GDI+ but I also need the ability to draw to the back buffer for smooth animation if I recall.

Pointers?

Advertisement

According to wikipedia:

DirectDraw has been deprecated since version 7. As of DirectX version 8.0, DirectDraw was merged into a new package called DirectX Graphics, which extended Direct3D with a few DirectDraw API additions. DirectDraw can still be used by programmers, but they must use older DirectX interfaces (DirectX 7 and below). As of the release of the June 2010 DirectX SDK package, the DirectDraw header file and library are no longer included.[2]

So in order to still use DirectDraw, you need to install a DirectX-SDK before June 2010, and set the paths so that it gets used. Not sure if there is still more you need to change, but this should be a starter.

Oh, and in my personal opinion, even for simpler graphics DirectX11 is still a nice thing to have. I work on a 2d-game in 16-bit style graphics, but I'm still glad I can write shaders here and there and can use zbuffers/cbuffers and what not. Its certainly a few weeks work to make the jump, especially if you have no previous experience with it; but I just thought I'd share my experience with DX11 in regards to simply 2D.

GDI is probably never going away, so you can still use it without any troubles.
If you use GDI however, where would DirectDraw even come in? Mixing both is possible, but not too performant.
You might get away with doing all in GDI.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Direct2D and DirectWrite might be options, and can work with Direct3D11 if you need to mix in some more advanced stuff.

Not sure how you are mixing GDI and DirectDraw.

Either Direct3D or Direct2D would be considered the “official” replacements depending on your goals. Unfortunately the GPU world has changed radically since DirectDraw was developed, so it no longer makes sense to keep updating it as a first-class API. However the old version definitely still works!

For simple shape/image drawing you may also want to consider using a third-party library like raylib: https://www.raylib.com/

This topic is closed to new replies.

Advertisement