Vector graphics are a great utility for developers, which SDL2 supports but partially(with functions like SDL_RenderDrawRect
and SDL_RenderFillRect
). Developers can use SDL2_gfx, but it uses pixel plotting (as noted by @rtrussell) to draw the shapes, which may be a bit inefficient. Another alternative is to use OpenGL/DirectX/Vulcan/Metal vector graphics libraries, but this solution requires the developer to handle cross-platform stuff (when using DirectX/Metal). On the other hand, SDL2 handles cross-platform API-s by choosing the most performant one.
So I propose to (only one of these ideas, choice goes to the developers of SDL2):
- add a new SDL2 “extension” library called
SDL_Vgfx
(if you think you find a better name, please suggest it) - introduce a new header file on the library (I propose
SDL_vg.h
) - add new drawing functions on the already existing
SDL_render.h
header
which contain new drawing functions likeSDL_RenderDrawCircle
,SDL_RenderDrawEllipse
,SDL_RenderDrawBezier
, etc.
The functions I propose are similar to those provided by SDL2_gfx, with the exception that the proposed functions should use better drawing algorithms (other than pixel plotting) where possible to gain performance. I propose that anti-aliasing should be a must for each of these drawing functions (where needed, of course).
Suggestions are welcome. Thank you for your time.