Highlighting vector graphics (.svg) in C ++

My friend and I are working on a 2D game where the graphics will be .svg files, and we will scale them accordingly either by rasterizing them or rendering them directly on the surface (which at some point will require rasterization).

The problem is that I searched all day to find a library that would allow me to take the .svg file and, ultimately, get it for visualization in allegro. As far as I know, this involves rasterizing into some format that can read allegro, and then allegro can display a flattened image.

So, which C ++ libraries could I use to take the .SVG file and β€œsmooth” it so that I can display it? Obviously, the library needs to support scaling so that I can scale vector graphics and then rasterize it.

I am using Windows and Visual C ++ Express 2010.

Any suggestions would be helpful as I am very lost right now:

I tried Cairo, but it allows you to write only .svg files and does not allow you to read the .svg file. I also looked at librsvg, which works with Cario, but I had a lot of problems getting it to work fine on Windows (because it has a lot of GNOME downloads). If you have instructions to make them work (on Windows), that's great too.

+9
c ++ windows vector-graphics allegro
source share
5 answers

The wxsvg library allows you to load and manipulate SVG files. Qt also has an SVG module .

+8
source share

I'm a bit late for the conversation, but I suggest you look at Nano SVG , an extremely easy SVG rendering that does not require cairo / libsvg. I got nanosvg assembled and working in a couple of hours. It is very simple, but he is doing his job.

+3
source share

The SVg ++ library provides extended support for reading SVG, so that rendering SVG with allegro can be implemented in a reasonable amount of time.

+2
source share

I recently put together an SVG visualization library in C ++: https://github.com/igagis/svgren

It uses Cairo to render off-screen. Supports gradients and all kinds of shapes.

+2
source share

Personally, I use NanoSVG in my Simple Viewer GL. This allows me to easily load and rasterize SVG images into multiple lines of code. But this library has poor SVG support.

0
source share

All Articles