GDI vs Direct2D

I heard Direct2D is better(as in graphics) than GDI cause it was introduced in Win 7. But which one is easier to learn? or which one should I learn first?
In general, I've found that configuration of Direct3D and its descendants is a chore due to the verbosity of the APIs. While I don't have much experience with GDI, I'm fairly sure that it just acts as an extension of WinAPI and would be much easier to configure. However, at the same time I'm fairly sure that GDI only allows for software rendering, which would cause a nice performance hit for more intense 2D applications.
Well, GDI is the starting point. So I would learn at least the basics of that before moving on to look at Direct2D, etc.

As Direct2D

The Direct2D API is designed to interoperate well with GDI, GDI+, and Direct3D.

So it sound like you'd typically use GDI for the basic stuff (as it's easier/more cost effective) and Direct2D when you need the power

I've mostly used GDI, which I see as just a regular part of the core Win32 API [1] (well, it's part of Petzold's Programming Windows book [2]). I've also used GDI+, which is pretty easier to pick up once you know GDI. And some DirectX (inc. Direct3D) which is rather more involved!


[1] The core of the Win32 API is provided kernel32.dll (base services), user32.dll (UI services), and gdi32.dll (graphics services). I'd also add advapi32.dll (advanced services) as it provides registry access, etc. And then you have the shell, the common controls and dialogs, network services, etc, etc, etc.
[2] Programming Windows®, Fifth Edition
Table of Contents
Last edited on
A few articles from MSDN on Direct2D:

Introducing Direct2D

Drawing with Direct2D

Layered Windows with Direct2D

If you are not bothered about older code, I would start with Direct2D.
closed account (S6k9GNh0)
Why not look into OpenGL or a software rendering library like SDL or SFML (which might or might no sit on an API like OpenGL/Direct2D).
SFML wraps around OpenGL and provides hardware acceleration, not just software, I think SDL 2.0 also provides hardware acceleration now.
Is SDL 2 out? The site is still pitching ver 1.2. I haven't seen an update in like 10 years.
closed account (S6k9GNh0)
Disch, SDL 2 isn't officially out. The wiki has been defaulted to SDL 2 though for nearly 3 years now. It's ridiculous. Their was a recent push to get SDL 2 out the door (thanks to Ryan Gordon) because of development on the Humble Indie Bundle games. Unfortunately, it's *still* not out and developers in IRC say the same thing they've said for years, "It'll be out when its ready". I've pretty much given up hope to be honest.

Ok thanks to you all. Right now I'm looking at GDI, then I'll move on to OpenGL or SFML. Any comments on which one I should learn next?

Thanks in advance...
closed account (S6k9GNh0)
SFML sits on top of OpenGL. OpenGL is rather complicated... As a result, I would suggest SFML/SDL2.
Yeah just glanced through SFML2.0 tut and it's great. Really good!!!
Thank you!
Topic archived. No new replies allowed.