mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-09-20 07:13:52 +00:00
Initial functioning work to get IPC working via UNIX sockets since ractors are still not a viable option :sad:
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user