Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If one were to code a game for most versions of Windows, which API should be used?

I know DirectDraw works from NT4 and up (although DirectDraw is emulated on NT4 with GDI). However, I am told DirectDraw is deprecated in newer versions of Windows?

I could revert to just GDI, but then it is hard to completely eliminate flicker, since there is no double buffering with flipping between buffers.

Should I go for Direct3D or DirectDraw? Or is there some way of completely eliminating flicker in GDI or some other Windows API I am not aware of?

If Direct3D is the answer, which version of it is supported on most platforms?

share|improve this question
Why does it have to be direct X, any reason? – The Communist Duck Dec 19 '10 at 17:53
No, it does not have to DirectX. – Prof. Falken Dec 19 '10 at 18:12
Consider something like SDL or SFML. (More a comment, since it isn't really answering the question) – The Communist Duck Dec 19 '10 at 18:39
I would usually, but I want to write something as small as possible for Windows, while supporting as large Windows version base as possible. I have looked a little at SDL and Allegro. – Prof. Falken Dec 19 '10 at 18:44
If you wanted the fewest dependencies possible and windows only (even then, I'd prefer x-platform for the flexibility) , then go for direct3D, just don't expect it very easy for 2D. As for versions, 9 for XP and 10/11 for Vista/7. – The Communist Duck Dec 19 '10 at 20:09
up vote 7 down vote accepted

I personally would not bother targeting anything below Windows XP. Writing something that works on XP/Vista/7 will get 99% of people on Windows and allow you to use modern technologies.

Direct3D is definitely an option, and so is DirectX. Another option is OpenGL.

I would personally recommend DirectX 9. There are a lot of great resources and tools that will allow you to pick it up quickly and build a good game with it. As I understand it, D3D and OpenGL are pretty ugly.

share|improve this answer
Even if I go for XP/Vista/7, I am fairly confident a big subset of XP users do not have DirectX9. – Prof. Falken Dec 20 '10 at 10:12
Doubtful, DX9 is getting pretty old. Many games include the redistributable anyways, or you could simply detect it's absence and point them to the download page for it. – Matthew Read Dec 20 '10 at 16:43
You might also wnat to look at XNA -- since it's built on top of DirectX 9. – Nate Dec 20 '10 at 17:02
+1 ^ for XNA. If you want more fine tuned control over performance, choose either Direct3D or OpenGL depending on which you would be more comfortable working with (or learning if you haven't used them before). But listen to Matthew and Nate, it's not worth targeting below XP and using a 2d engine like XNA or SFML will save you lots of time. – michael.bartnett Dec 21 '10 at 2:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.