views:

711

answers:

2

I have a mature MFC C++ application that displays on screen and prints using CDC wrappings on the Win32 GDI. While it has been optimized over the years, I would like to replace it with something a bit faster. The graphics included rendered triangular surface models, complex polylines and polygons, and lots of text. It needs to meet the following criteria;

  • The number of vectors displayed is likely to be very large. For example a single surface triangle is likely to generate a number lines and solid fills when rendered. At present this information is not stored anywhere, it is generated and drawn on the fly. The SDK should support limit the total number of buffered vectors, or it is liable to run out of memory.

  • The SDK should be able to render to any CWnd derived class including CView and ScrollView classes.

  • The SDK should support printing to any Windows print device,

  • The SDK should be low level enough to make the port from low level CDC / GDI calls relatively straightforward.

  • Open source is always nice, but a one off cost of up to say $2k, with optional upgrades/support would also be ok. A license cost per user is not acceptable,

  • Access to source code would be a big bonus, specifically with the idea of running portions of the SDK on Windows CE / Mobile.

  • I currenly handle my own 3d to 2d viewport management. If a decent low level SDK is not available, a higher level SDK must handle 3d well, and work with millions of triangles, polygons and text entities on a 32 bit windows platform.

Any suggestions? Listing the specific pros and cons in your proposed suggestion would be greatly appreciated.

+2  A: 

I think DirectX or SDL will suit your needs. They are designed for 3D but work for 2D as well. Both support Windows CE / Mobile and SDL is also available for a bunch of non-Microsoft OS.

Unfortunately direct compatibility with GDI is not supported in the libraries. But you can do the trick by creating a converter class, which will accept all output graphics from your GDI designed application classes and convert the format to fit the needs of DirectX or SDL classes (depending what do you want to use).

Personally I made such converter class once. I had a game written for Pocket PC, using SDL and I needed to port it to Palm device. There I had to use different graphics library (I don't remember the name of the lib now) but I succeeded to port all SDL functions output to the format needed by the other lib. I needed to change my application to call the converter (wrapper) functions, which forwarder the call to Palm or Pocket PC library, depending on which device it is currently running. So I think you can do the same for converting GDI -> DirectX or GDI -> SDL.

m_pGladiator
Can either support printing?
Aardvark
+1  A: 

I have once evaluated FastGraph (http://www.fastgraph.com) for a project. I liked it in the small test programs I wrote, it was very fast. We ended up not using it for external reasons (nothing to do with the libraries that I evaluated) so I don't have more practical experience.

Roel
Thanks for the link. I used FastGraph for DOS many years ago and liked it at the time. Didn't think it was still around.
Shane MacLaughlin