rhio is a minimal Render Hardware Interface (RHI) built around an explicit device/backend contract. It lets rendering code stay portable across graphics APIs without hiding backend ownership or lifecycle rules behind a heavy framework.
It picks up where LeveGL and Vulkano left off: one C API over both the OpenGL family and Vulkan.
Features
- Header-only: drop in
rhio.h and define RHIO_IMPLEMENTATION in one translation unit. - Pure C99 for portability across compilers and platforms.
- Backend chosen at device creation: OpenGL 3.3, OpenGL ES 2.0/3.0 or Vulkan 1.4.
- Thin vtable dispatch: explicit function tables, small binary footprint, manual resource management.
- Extensible: custom backends plug into the same vtable hooks.
Tech
- C99 for the whole library
- OpenGL, OpenGL ES and Vulkan backends
- Example suite under
examples/
What I learned
- Drawing the line between a portable API and what each backend has to own.
- Mapping OpenGL’s implicit state onto Vulkan’s explicit resources, and the other way round.
- Keeping a vtable-based C API small enough to read in one sitting.
Links