p5.js is a JavaScript library for creative coding, providing a comprehensive API for 2D/3D graphics, animation, interaction, and data visualization. It is designed for artists, designers, and educators, with a focus on accessibility and beginner-friendly error messages. The architecture is modular: a core module registers addons for color, shape, WebGL, DOM, I/O, math, and more. It supports multiple renderers (2D canvas, WebGL 3D, experimental WebGPU) and includes a sophisticated shader compilation pipeline (strands) that transpiles a p5.js-like DSL to GLSL/WGSL. The codebase is well-structured with extensive unit and visual regression tests, and it follows a consistent addon registration pattern for extensibility.
raylib is a cross-platform game development library written in C99, designed to provide a simple and easy-to-use API for creating games, prototypes, and multimedia applications. It abstracts away platform-specific details like window creation, input handling, and graphics rendering, offering a consistent interface across Windows, macOS, Linux, Android, and Web (via Emscripten). The library is modular, with core modules for shapes, textures, text, 3D models, audio, and shaders, all built on top of a low-level OpenGL abstraction layer (rlgl). It bundles its own windowing backend (a fork of GLFW) and includes numerous single-file external libraries for image loading (stb_image), audio decoding (dr_flac, dr_mp3, dr_wav, jar_mod, jar_xm), compression (sdefl, qoa, pep), and model loading (tinyobj_loader, cgltf, vox_loader). The repository contains over 200 example programs that serve as both documentation and test cases, covering everything from basic window creation to advanced shader effects and 3D rendering pipelines. The architecture follows a monolithic library pattern with a single public header (raylib.h) and several optional headers (raymath.h, rlgl.h, raygui.h). The core library is compiled from source files (rcore.c, rshapes.c, rtextures.c, rtext.c, rmodels.c, raudio.c) and platform-specific backends (rcore_desktop_glfw.c, rcore_android.c, rcore_web_emscripten.c, etc.). The library is designed to be self-contained, with no external runtime dependencies beyond the operating system's graphics drivers. Build system support includes CMake, Make, Zig, Meson, and IDE project files for Visual Studio, VSCode, CodeBlocks, and others. Key data flows involve initializing a window and graphics context, then entering a game loop where user input is polled, game state is updated, and rendering commands are issued. The library handles resource management (textures, fonts, models, audio streams) internally, with automatic cleanup on window close. The audio subsystem supports streaming, effects, and multi-channel playback. The shader system allows custom GLSL vertex and fragment shaders to be applied to 2D and 3D rendering. The library also includes utility modules for math (vectors, matrices, quaternions), easing functions, gesture recognition, and camera systems. External dependencies are minimal due to extensive bundling; the only required system libraries are OpenGL (or OpenGL ES on mobile/web) and the platform's native windowing/input APIs. The bundled GLFW fork provides a consistent windowing layer across platforms. The library is actively maintained with regular commits, CI builds for multiple platforms, and a large community of users and contributors.
LVGL (Light and Versatile Graphics Library) is an embedded GUI library written in C, providing a comprehensive widget toolkit (30+ widgets), style system, layout managers (flex, grid, split), animation framework, and multiple rendering backends (software, GPU-accelerated via VG-Lite, NanoVG, OpenGL ES, and hardware-specific backends for various MCU/MPU platforms). It is designed for resource-constrained devices with a small memory footprint (~100kB RAM for typical UIs) and supports a wide range of display drivers (SDL, Wayland, DRM, UEFI, Windows, and many embedded display controllers) and input devices (touch, keypad, mouse, gestures). The library features a public/private header pattern for encapsulation, a configurable build system via Kconfig, extensive Unity-based test suites with screenshot comparison, and a GDB plugin for runtime introspection. It is actively maintained with frequent commits, comprehensive CI/CD, and a large ecosystem of examples and demos.
This is a Rust library, `softbuffer`, that provides a cross-platform API for software-rendering a pixel buffer to a window. The core abstraction is a `Context` (associated with a display), a `Surface` (associated with a window), and a `Buffer` (a writable pixel array). The user gets a buffer, fills it with pixels (via `&mut [Pixel]`), and presents it to the compositor. The library supports multiple platforms (Wayland, X11, Windows, macOS/iOS, WebAssembly, Android, DRM/KMS, Orbital) using a clean trait-based backend dispatch mechanism. It does not provide its own rendering primitives; instead it focuses on efficiently transferring CPU-written pixel data to the display server, aiming for zero-copy where possible. The codebase is well-structured with thorough documentation, error handling, and CI testing across many targets.
NanoSVG is a C library for parsing and rasterizing SVG files. It consists of two single-header files: nanosvg.h for parsing SVG into cubic bezier paths, and nanosvgrast.h for rasterizing those paths into RGBA pixel data. The library handles a wide range of SVG features including basic shapes (rect, circle, ellipse, line, polyline, polygon, path), fills, strokes, linear and radial gradients, and transformations. Designed for ease of use in applications and games, it requires only standard C libraries and can be integrated by simply copying the header files and defining the appropriate implementation macros. The parser (nanosvg.h) reads SVG files through a custom XML parser and converts them into a structured representation of bezier paths. It properly handles SVG coordinate systems, viewBox transformations, and unit conversions (px, pt, pc, mm, cm, in). The rasterizer (nanosvgrast.h) then takes this path data and converts it to a pixel buffer using a scanline rasterization algorithm with anti-aliasing. Together, these components provide a complete solution for rendering SVG content in applications that need vector graphics support without heavy dependencies. While the README notes the project is not actively maintained, the library continues to be widely used due to its simplicity, reliability, and permissive zlib license. Its single-header design makes it particularly suitable for embedding in projects where minimizing dependencies is important, such as game development or desktop applications.
MethaneKit is a cross-platform graphics rendering framework that provides abstractions over DirectX 12, Vulkan, and Metal APIs. It features a layered architecture with platform-independent interfaces (RHI), platform-specific implementations, an application framework, UI components, and mathematical utilities. The framework includes tutorial applications demonstrating various graphics techniques from basic triangle rendering to compute shaders and parallel rendering. Key systems include resource management, command submission, pipeline state handling, and synchronization primitives. The codebase demonstrates modern C++ practices with extensive use of templates, PIMPL idiom, and interface-based design.
Win2D is a production-grade Windows Runtime 2D graphics library that wraps Direct2D, DirectWrite, Direct3D, and WIC into a WinRT API for use in UWP and WinUI3 applications. It provides immediate-mode GPU-accelerated rendering through XAML controls (CanvasControl, CanvasAnimatedControl, CanvasSwapChainPanel), drawing sessions, brushes, geometries, text layout and analysis, SVG documents, printing, and over 70 image effects. The library is packaged as a NuGet package (Microsoft.Graphics.Win2D) and supports C#, C++/CX, C++/WinRT, and VB.NET consumers. Architecturally, Win2D is a WinRT component implemented in C++/WinRT with a DLL entry point (module.cpp) that registers activation factories and telemetry. The core rendering logic lives in winrt/lib/, organized by subsystem: drawing (CanvasDrawingSession, DeviceContextPool), effects (generated wrappers and custom pixel shader support), text (DirectWrite wrappers), geometry, brushes, SVG, printing, and XAML controls. A code generation tool (tools/codegen) produces IDL and effect implementations from XML definitions, ensuring consistency across the large effect surface. The library relies on external dependencies including Direct2D, DirectWrite, Direct3D 11, Windows Imaging Component (WIC), and the Windows App SDK (for WinUI3). Key entry points for developers are the XAML controls (CanvasControl, CanvasAnimatedControl) which provide CreateResources and Draw events, and the CanvasDrawingSession which exposes all drawing operations. The library also includes extensive interop interfaces (ICanvasImageInterop, ICanvasResourceWrapperNative) for integrating with native Direct2D code. Testing is comprehensive, with internal C++ unit tests using mocks/stubs, external integration tests with real devices, and managed C# tests.
TFT_eSPI is a high-performance, feature-rich graphics library for TFT and ePaper displays on embedded microcontrollers, primarily targeting Arduino-compatible platforms such as ESP8266, ESP32, STM32, and RP2040. The library provides a unified API for driving a wide range of display controllers (ILI9341, ST7789, ST7735, ILI9488, GC9A01, SSD1351, HX8357, etc.) over SPI, 8-bit parallel, or 16-bit parallel interfaces. It includes extensive drawing primitives (lines, circles, arcs, ellipses, polygons, anti-aliased shapes), sprite-based off-screen rendering, touch screen support (XPT2046), a button widget, and a sophisticated anti-aliased (smooth) font system that can load fonts from flash or filesystem (SPIFFS/LittleFS/SD). The library is highly configurable via compile-time defines and user setup files, and it leverages hardware-specific optimizations like DMA transfers, PIO state machines (RP2040), and dual-core processing. It is designed for real-time embedded GUIs, instrumentation, and interactive projects, and is widely used in the maker community.
Matplot++ is a C++ graphics library for data visualization that provides a MATLAB-like API for creating publication-quality plots. It supports a wide range of plot types including line, scatter, bar, histogram, surface, contour, polar, geographic, and 3D plots, as well as image display, graph visualization, and annotations. The library is designed for scientific computing and engineering applications, offering both free-standing function calls and an object-oriented interface with method chaining. It features a pluggable backend architecture with Gnuplot as the primary rendering backend (via pipe communication) and an experimental OpenGL backend. The library handles data transformation, automatic tick calculation, colormap interpolation, contour generation (adapted from Matplotlib), histogram binning with multiple algorithms, and geographic map rendering using bundled Natural Earth data. External dependencies include Gnuplot 5.2.6+ at runtime, with optional support for image processing libraries (CImg, JPEG, TIFF, PNG, OpenCV) and numerical libraries (FFTW, LAPACK, BLAS). The build system is CMake-based with comprehensive options for testing, examples, and documentation generation. Architecturally, the library is organized around a core figure-axes-object hierarchy: figure_type manages the canvas and backend, axes_type holds plot objects and axis configuration, and individual plot types (line, bars, histogram, etc.) inherit from axes_object and implement backend-specific rendering methods. Free-standing functions in freestanding/ forward calls to the current axes via a global figure registry. The backend interface abstracts rendering commands, allowing the same plot objects to work with different backends. The library includes a large set of examples (200+) that serve as both documentation and integration tests, and a documentation pipeline that auto-generates a gallery from example executables. Key entry points for users are the matplot.h header and the free-standing functions (plot, hist, surf, etc.). The library is consumed via CMake's find_package or as a subdirectory. It supports both interactive (reactive) and non-interactive (quiet) modes, and can save plots in multiple formats (SVG, EPS, PNG, PDF, etc.) through backend-specific commands.
MGL is a graphics library that implements an OpenGL compatibility layer on top of Apple's Metal API. It translates OpenGL API calls into Metal rendering commands, allowing developers to use OpenGL-style programming on macOS without relying on legacy drivers. The library includes a shader compilation pipeline (GLSL to MSL via SPIR-V), a math library (GLM), and windowing support (GLFW). It is designed for high-performance rendering and virtualization contexts, evidenced by comments regarding QEMU framebuffer blitting. The codebase is a monolithic C/ObjC library with a dispatch table pattern for API routing.