views:

631

answers:

2

I'd like to use Direct2D for my .Net application using the Windows Code pack. Since some of my users are using XP, I need to provide a GDI+ fallback. I wonder how people usually do this kind of fallback.

Do they abstract/interface all the necessary graphics feature into some custom generic library? If so, is there any open-source library for direct2d/GDI?

Thanks, Gil.

+1  A: 

You'll have to re-program it in Direct3D if you want it to run as fast.

bobobobo
+2  A: 

The way I do it is by having two completely seperate classes (both derived from an IRenderer interface). On load, I determine the operating system version using Window's GetVersionEx function. If dwMajorVersion >= 6, then I load the Direct2D class; otherwise it falls back to GDI.

Hope this helps.

Saul Rennison