I'm making a game and want to use vector graphics. I started re-coding it using Cairo and the performance is horrific. So, I'm looking for a different library. It needs to be for C++ and cross-platform (e.g. no Direct2D). There's another question someone asked before like this, but there weren't any suitable answers. There's got to be something...?
closed as off-topic by Maximus Minimus, Trevor Powell, Seth Battin, Josh♦ May 21 '14 at 3:35
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Maximus Minimus, Trevor Powell, Seth Battin, Josh
I fear the subject is quite tricky, few multi platform solutions seem to have launched, and even fewer seem to have survived on their own. I was looking into the subject a few months ago. I had a constraint as I needed the engine to run on iOS and Android. Didn't find anything that suited me really at the time.
But a few pointers from what I remember: each GUI system has some form of drawing API. So you might find something of interest within the ones that are cross platform like QT.
An equivalent of cairo would be AntiGrain You might want to compare the performance.
OpenFrameworks has support for vector graphics.
A very big library which has some vector graphics support - and a language dedicated to it - is ImageMagick.
Not a high level API - and I'm not sure what are the odds it will suit you - but there is the standard OpenVG. There are multiple ports of OpenVG over software OpenGL and OpenGL ES renderers. Mesa 3D also seems to have an OpenVG implementation. But for some platforms only commercial solutions will be available.
There are way higher level libraries which integrate APIs for vector graphics. Among these there is an open source one named Clutter for GUI design and used in serious game design there is scaleform (Not Open Source). This game engine has some functions to draw vector graphics: 2DEngine
EDIT: clutter uses cairo apparently.
MonkVG is a cross platform OpenVG emulation on top of OpenGL ES 1.1 and 2.0. See: https://github.com/micahpearlman/MonkVG
Note: I'm the original author and maintainer of this library. It has a very liberal BSD license.
I ended up not bothering and just going with high-res images and scaling with OpenGL. It works well enough for my situation.