Reputation: 1069
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.
Upvotes: 4
Views: 3359
Reputation: 1002
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.
Upvotes: 4
Reputation: 67286
You'll have to re-program it in Direct3D if you want it to run as fast.
Upvotes: 2