Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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...?

share|improve this question
    
The "question asked before", do you mean gamedev.stackexchange.com/questions/4788/… ? –  Tetrad Oct 21 '11 at 0:08
    
@Tetrad: The previous question implicitly excludes multi platform as it explicitly requests solutions for windows. And the answers seem to point only to Windows related solutions. –  Coyote Oct 21 '11 at 1:29
2  
@Zach Hinchy: When you say cross platform you mean what exactly? Windows, Linux, OS X? Or do you include handheld platforms iOS, Brew, Android? –  Coyote Oct 21 '11 at 1:32
2  
"There's got to be something...?" Why? Vector graphics, in general, is not something that people who need 30+fps do. Does your web browser load pages at 30fps? No. 10fps is plenty. If you use vector graphics, it's because you value quality over performance. And thus, vector graphics libraries value quality over performance. Cairo itself isn't slow, but it is a quality vector graphics renderer. And that quality means that it doesn't cut corners for performance. –  Nicol Bolas Nov 9 '11 at 5:40
1  
@iamcreasy: There is a big difference between simply drawing a quad bigger/smaller and a vector graphics library. Games render with the GPU; they do not use a vector graphics library. They do not use Cairo or AntiGrain or anything of those natures. –  Nicol Bolas Nov 9 '11 at 18:50
show 2 more comments

2 Answers

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.

Lower level you'll find Libxmi and Libart from the gnome project.

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.

share|improve this answer
add comment
up vote -3 down vote accepted

I ended up not bothering and just going with high-res images and scaling with OpenGL. It works well enough for my situation.

share|improve this answer
2  
You asked about a library but accepted an answer where it says, just pick the other way around(ignoring the fact that its yours answer). Its not a good judgement. (also ignoring the fact that it maybe took @Coyoto around 15 min to write his answer). Have a nice day! –  iamcreasy Nov 9 '11 at 9:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.