2d primitives and images: OpenGL, Cairo or Agg

I make a game and thought about using vector shapes for the user interface. I want to know what is the best render for this. I think Agg is faster than Cairo, but Cairo can use hardware acceleration, if available. What about opengl? Is it a good idea that I use gl textures for images and lines to make rectangles, rounded rectangles and circles? Or is it better I make cairo surfaces in opengl? Other alternatives I have found are Google Skia and SFML. What do you think of Skye? SFML also draws polygons. I can make rounded shapes using polygons. I even think about using SDL or SFML for event management. In both cases, I can create an OpenGL context, and I'm used to their roles in managing events that are cross-platform. I want a cross-platform solution. It should work on Linux, Mac, and Windows.

+4
source share
1 answer

If you are already using OpenGL to render your game, the only thing you do not need to do is use any kind of software rendering to draw the game’s user interface. Therefore, either use the Cairo OpenGL backend (which I do not understand very well) or render in OpenGL. Otherwise, you will kill your performance with all transfers of pixels from the CPU memory to the GPU.

+5
source

All Articles