Small Ruby adapters for metaco textures, pixels, events, and resize data.
Features · Installation · Quick Start
metaco-ext adds Ruby-side helpers around the native metaco API. Resource methods delegate to metaco, while event helpers provide a stable, normalized shape for graphics applications.
- Texture create, update, bind, and destroy helpers.
- Compute and framebuffer pixel readback delegation.
- Frozen, symbol-keyed event normalization.
- Logical and framebuffer dimensions in resize events.
- No in-memory substitute for native texture resources.
Add the extension to your Gemfile:
gem "metaco-ext"For native resource methods on macOS, add metaco too:
gem "metaco"Then run bundle install, or install the gem directly:
gem install metaco-extOn macOS, install both gems for native resource methods:
gem install metaco metaco-ext- Ruby 3.1 or newer.
- Native resource methods require a compatible metaco installation and are available on macOS only. Calls without metaco raise
LoadError.
require "metaco/ext"
resize = Metaco::Ext.resize_event(
width: 800,
height: 450,
framebuffer_width: 1600,
framebuffer_height: 900
)
puts resize[:framebuffer_width]Native texture operations require a metaco build with texture support:
texture = Metaco::Ext.texture_create(handle, 2, 2, rgba_bytes)
Metaco::Ext.bind_compute_texture(handle, 0, texture)bundle install
bundle exec rake verifyBug reports and pull requests are welcome at rbgfx/metaco-ext.