Best approach to Rendering Vector Graphics with SDL?

I know that this is an old post, but a recent project idea has had me thinking about this too, so

The answer depends on what your vector graphics are made of, and why you’re interested in using a vector graphics format in the first place.

If you just like the resolution independence of vector graphics, just predraw them into an SDL_Surface at the earliest point that the resolution is known. For example if you just want the graphic to look the same between devices, you can find the resolution of the device display immediately after initializing SDL and draw the graphic into an SDL_Surface when you first load it.

If your graphics are going to be scaled frequently and you want to avoid blurring effects at high scales and loss of detail at low scales (from bilinear filtering), create and manage your own mipmaps (repeatedly draw into surfaces starting from the largest scale to the smallest) - unfortunately SDL doesn’t support trilinear filtering AFAIK but nearest mipmap interpolation should work reasonably well.

(As was stated earlier, rasterizing vector graphics with beziers is computationally expensive. I recommend doing this in a background thread, or where you already require a loading screen for other reasons)

If you want to use vector graphics as 2d polygonal models and don’t use curves anywhere, SDL_gpu supports triangle rendering, or you can roll your own triangle rendering in OpenGL (just using SDL for platform independence)

If you want to use vector graphics as 2d polygonal models and do use curves, you can either build your own triangle mesh at an acceptable LOD using a subdivision method such as deCastlejau’s algorithm or treat control points as triangle vertices and use fragment shaders (SDL_gpu also supports shaders if you want to avoid using OpenGL directly).

At least these are my reasons for looking at using vector graphics for my next project, I’m honestly not too familiar enough with the intricacies of 2D vector graphics yet to be of much help beyond that. I haven’t even rolled any code yet.