Metaco

Native macOS · Cocoa · Metal

A native window, from Ruby.

A Ruby C extension for macOS windows, pixel presentation, event polling, and Metal compute.

gem install metaco

● ● ●Ruby GraphicsmacOS
Ruby → Cocoa → Metal
Cocoa windowRuby calls → native APIs

A focused bridge to the host.

Create a native window, push RGBA pixels, receive input, or run Metal compute.

01

Open a Cocoa window

Create, update, present, and destroy windows from Ruby.

02

Handle events

Poll keyboard and mouse data in the application loop.

03

Use Metal compute

Check support, compile MSL, and dispatch compute work.

A small first step

Start with one example.

Install the gem, then follow the project guide for platform requirements and the full API.

Read the installation guide ↗

require "metaco"

Metaco.init
handle = Metaco.window_create(
  800, 600, "My Window",
  resizable: true, high_dpi: true
)
begin
  # rgba_bytes contains width * height RGBA pixels.
  Metaco.set_pixels(handle, rgba_bytes, 800, 600)
  Metaco.present(handle)
ensure
  Metaco.window_destroy(handle)
end