grimfang4/sdl-gpu logo

grimfang4/sdl-gpu

Free

A library for high-performance, modern 2D graphics with SDL written in C.

FreeFree tier
Type
Open Source

About grimfang4/sdl-gpu

SDL_gpu is a C library designed to simplify hardware-accelerated 2D graphics using SDL (either SDL 1.2 or 2.0). It provides high performance through automatic batch collection and state change reduction, supports shader APIs (OpenGL 1.1-4.0, OpenGL ES 1.1-3.0), arbitrary geometry (triangles), full blend state control, and built-in primitive shapes (points, lines, rectangles, ellipses, polygons, arcs). It can load BMP, TGA, and PNG images via stb-image and offers adjustable anchor points for rotation/scaling. SDL_gpu is open source under the MIT License and is suitable for game development and other 2D rendering applications that require hardware acceleration.

Key Features

Automatic batch collection and redundant state change reduction for high performance
Shader API support (OpenGL 1.1, 2.0, 3.0, 4.0; OpenGL ES 1.1, 2.0, 3.0)
Arbitrary geometry rendering (triangles)
Full blend state control
Built-in primitive shapes (points, lines, triangles, rectangles, ellipses, polygons, arcs)
Compatible with SDL 1.2 or SDL 2.0
Loads BMP, TGA, and PNG images via stb-image
Adjustable anchor points for rotation and scaling around image centers
Can be integrated with explicit OpenGL calls (mixed 2D and 3D)

Pros & Cons

Pros
  • Automatic batch submission reduces draw call overhead for high performance
  • Supports multiple OpenGL and OpenGL ES backends for broad hardware compatibility
  • Offers a familiar API for SDL developers, making it easy to adopt
  • Built-in primitive shapes reduce need for external asset generation
  • Open source under MIT License with no cost
Cons
  • Documentation may be limited to auto-generated Doxygen output

Best For

Developing hardware-accelerated 2D games using SDLCreating graphical applications that need efficient sprite batchingRendering 2D graphics with shader effectsReplacing the SDL2 Render subsystem with a more flexible GPU-accelerated pipelineBuilding cross-platform 2D rendering tools (Windows, Linux, macOS, Android, iOS)