Open a Cocoa window
Create, update, present, and destroy windows from Ruby.
Native macOS · Cocoa · Metal
A Ruby C extension for macOS windows, pixel presentation, event polling, and Metal compute.
gem install metaco
Create a native window, push RGBA pixels, receive input, or run Metal compute.
Create, update, present, and destroy windows from Ruby.
Poll keyboard and mouse data in the application loop.
Check support, compile MSL, and dispatch compute work.
A small first step
Install the gem, then follow the project guide for platform requirements and the full API.
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