Is Direct2D the Next 2D API?

Posted by Matt | Filed under , ,

I have been doing some work with Direct2D over the last couple of weeks converting our current GDI-based 2D-cad application over to a Direct2D-based application.  One huge problem for us though is XP support.  Direct2D is available for Windows 7 and Vista only.  So what do we do for our XP customers?

Currently, I’m having to basically abstract the rendering.  So essentially, I’ve created a rendering interface with 2 implementations:  Direct2D and GDI.  In the end, this actually will work out in our favour because we’ll be able to do an OpenGL implementation for the Mac.  I suppose I could do a Direct3D9 implementation for XP customers as well.

I read some of the questions and answers over at Responding to comments - 2D drawing APIs in Windows.  One of the comments was:

The vision going forward is that D2D is *the* 2D API. We are very interested in any feedback that could tell us what is blocking this going forward. 

I think that lack of XP support is what is keeping Direct2D from becoming *the* 2D API.  At this stage, it’s very difficult for a developer to create a Direct2D-exclusive application.  Many developers still need to support customers who still don’t have motivation to upgrade to Vista or Windows 7.  Maybe this will change come October 22.

Another thing (which I commented on at the above blog entry) is that I think if they want Direct2D to become *the* 2D API, then they need to add it to the application wizards and do some hide-behind with MFC.  The reason is that currently, a developer can create a new app using the wizards, and immediately draw to the GDI device context.  They don’t have to set anything up, they don’t have to do any checks for hardware, etc.  Microsoft needs to have this same thing for Direct2D.  Let MFC deal with the factory creation, render target creation, begin scene, end scene etc. and just provide to a render function a final ready-to-use render target.

I am not saying that this will be the most optimal way of using it in applications, but it will reduce the learning curve for people.

I do want to add that I really like Direct2D in and of itself.  It’s a very clean interface and does everything that I would need it to do.  And it does it fast. 

To answer the initial question:  I think it is the next 2D API, but I don’t think that it, Microsoft, and customers are ready for it to be the current 2D API.

Direct2D Resources