Initial functioning work to get IPC working via UNIX sockets since ractors are still not a viable option :sad:

This commit is contained in:
2026-08-24 23:01:27 -05:00
parent c6ee9eab31
commit d77408484a
12 changed files with 131 additions and 52 deletions

View File

@@ -4,6 +4,8 @@ module W3DHubLauncher
WHITE_IMAGE = Gosu.render(64, 64, retro: true) { Gosu.draw_rect(0, 0, 32, 32, Gosu::Color::WHITE) }
def safe_get_image(path, retro: false)
raise RuntimeError, "Images may only be loaded from the main thread!" unless Thread.current == Thread.main
return get_image(path, retro: retro) if File.exist?(path)
path = "#{ROOT_PATH}/media/default.png"
@@ -21,5 +23,9 @@ module W3DHubLauncher
circle.draw(0, 0, 1, 1, 1, 0xff_ffffff, :multiply)
end
end
def on_main_thread(block)
window.add_to_queue(block)
end
end
end