record all Windows, add Window.event_loop
This commit is contained in:
1 parent
8604d6d5ad
commit
b908c98c8c
3 files changed
+51
-37
No files matched your search
@@ -1,7 +1,26 @@
|
||||
require "set"
|
||||
|
||||
class Window
|
||||
@windows = Set.new
|
||||
|
||||
class << self
|
||||
def register(window)
|
||||
@windows << window
|
||||
end
|
||||
|
||||
def remove(window)
|
||||
@windows.delete(window)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize
|
||||
@programs = {}
|
||||
load_shaders
|
||||
Window.register(self)
|
||||
end
|
||||
|
||||
def close
|
||||
Window.remove(self)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in new issue
Block a user