SDLgfxPrimitivesh
SDLgfxPrimitivesh is the standard header file for the SDL_gfx library, a portable extension to the Simple DirectMedia Layer (SDL) that provides a collection of drawing primitives for 2D graphics. The library was developed to supply developers with basic shape functions—such as lines, rectangles, circles, ellipses, arrows, and filled polygons—that are not part of the core SDL API. It relies on SDL for surface handling and event management, making it a lightweight addition to any SDL-based project.
The header declares a set of rendering functions prefixed with "gfx" (e.g., gfxPrimitives.h defines gfxRectangle, gfxEllipse,
SDL_gfx is cross-platform, available for Windows, macOS, Linux, and embedded systems such as Raspberry Pi. It
Typical usage involves initializing SDL, creating an SDL_Surface or SDL_Renderer, and calling the desired primitive functions
```
SDL_Surface screen = SDL_GetWindowSurface(window);
gfxRectangle(screen, 10, 10, 200, 150, 0xFF0000FF); // Red rectangle
SDL_UpdateWindowSurface(window);
```
The library also includes helper functions for workload measurement and color manipulation. Documentation is provided in