PDA

View Full Version : SVG Rendering with Anti-Grain Geometry Lite



wraggster
April 8th, 2008, 01:35
News/release from qw3rky (http://forum.gbadev.org/viewtopic.php?t=15335&sid=ea16820d653d3bde611213e30072ad5a)


Anti-Grain Geometry is an awesome library for software rendering of 2D vector graphics (see here). As soon as I saw it, I wanted to get it running on the DS. The full library is a bit large and uses lots of floating point, which is kind of a problem. But there is a cut-down version called AGG Lite which fits perfectly well on the DS. I downloaded the code, did some massive reorganization (the AGG author's code was far too messy for my taste), cut out any remaining floating point usage, and added a color format class specifically for the DS, and the result is pretty nice. You can check out my open-source clean-up effort at http://brian.grogan.jr.googlepages.com/agg_lite_ds.zip. Compare with the original.

After I whipped AGG Lite into shape, I thought to myself, "wouldn't this go so nicely with that small, fast XML library (Mini-XML) I found a few months ago?" (download pre-compiled for DS) So I put the two together to come up with a totally alpha quality SVG renderer.

It only handles a minuscule subset of the SVG specification (the rect element), so ... now you can draw rectangles ... with SVG!? It's not much yet, but I'm a follower of the agile development principle, "get something simple working fast." I'll put some more work into this to support other SVG elements later on, but for now, you can render trivial SVG on the DS.

This uses libfat to load the SVG files, so of course remember to dldi patch the nds file before using. And if you want to build from source you'll need the Mini-XML and AGG Lite libraries posted in the project links above.

download:
http://brian.grogan.jr.googlepages.com/agg_svg.zip

Akoi Meexx
April 8th, 2008, 18:26
I officially think this guy rocks.

I do most of my design work in Inkscape, so I can't wait to see more effort put into this. :thumbup:

Kaeruyaki
April 10th, 2008, 06:42
sweet. I love little tools like this. It'll be nice to dabble in polys on the go :)