I'm making a game and thought about using vector shapes for the UI. I want to know what the best renderer for this. I think Agg is faster than Cairo, but Cairo can use hardware acceleration if it's available. And how about opengl? Is a good idea I use gl textures for images and lines to do rectangles, rounded rectagles and circles? Or is better I render cairo surfaces in opengl? Other alternatives I found are Google Skia and SFML. What do you think of Skia? The SFML also draws polygons. I can make rounded shapes using polygons. I'm even thinking of using SDL or SFML to control events. In both I can create an OpenGL context and I've gotten used to their roles in control of events, which are crossplatforms. I want a cross-platform solution. It should work in linux, mac and windows.
4
votes
1 Answers
6
votes
If you are already using OpenGL to render your game, the one thing you should not do is use a software renderer of any kind to draw the game's UI. So either use Cairo's OpenGL backend (which I understand is not particularly good) or do the rendering yourself in OpenGL. Otherwise, you'll kill your performance with all of the pixel transfers from CPU memory to the GPU.