Ream is a C++ graphics library for Linux. It provides generic buffer allocation and rendering utilities, abstracting the underlying platform and graphics API while still allowing direct access to API-specific features when needed.
It is developed primarily as the rendering foundation for Wayland compositors, but is useful for any Linux application that needs to allocate GPU buffers, share them across devices via DMA-buf, and draw into them with a portable API.
Check the releases section for stable versions. The web documentation corresponds to the latest release.
- RAII-based resource management
- Platform abstraction
- Graphics API abstraction
- Flexible buffer allocation (native, GBM/DMA-buf, dumb buffers)
- Multi-threading with automatic or manual synchronization
- High-performance built-in painter
- Out-of-the-box Skia integration
- Hybrid (multi-)GPU support with cross-device DMA-buf sharing
- Explicit synchronization via
sync_filefences
- DRM
- Wayland
- Offscreen
- Raster
- OpenGL ES 2.0
- Vulkan
Ream is designed to abstract away the underlying platform and graphics API (GAPI), allowing your code to remain platform- and API-independent by default.
To ensure portability, use the classes provided directly under the CZ/Ream directory. For example, to create an image, use RImage::Make(), which will internally return an appropriate implementation such as RGLImage, RSImage, or RVKImage, depending on the active GAPI.
Platform- and API-specific implementations reside in the CZ/Ream/GL, CZ/Ream/RS, CZ/Ream/VK, etc. subdirectories. In cases where you need access to API-specific functionality, most classes provide safe downcasting methods, e.g. image->asGL().
The RCore class exposes information about the current platform and GAPI. It can be accessed globally via RCore::Get().
See the Abstraction page for details.
-
CZ_REAM_GAPI: Overrides the graphics API selection when
RCoreis initialized withRGraphicsAPI::Auto. Accepted values areGL(OpenGL),VK(Vulkan), andRS(Raster). -
CZ_REAM_LOG_LEVEL: Sets the minimum log level for runtime output. Available levels (from least to most verbose): 0: Silent, 1: Fatal, 2: Error, 3: Warning, 4: Info, 5: Debug, 6: Trace.
The full list, including backend-specific variables, is documented on the Environment page.
Ream uses the Meson build system:
meson setup build
ninja -C build
sudo ninja -C build install