Class: Stagecraft::Window::Sdl3
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Adapter
#on_pointer_button, #on_pointer_move, #on_resize, #on_scroll
Constructor Details
#initialize(title:, width:, height:, resizable: true) ⇒ Sdl3
Returns a new instance of Sdl3.
8
9
10
11
12
13
14
|
# File 'lib/stagecraft/window/sdl3.rb', line 8
def initialize(title:, width:, height:, resizable: true)
super()
require "wgpu"
require "wgpu/window"
@native = WGPU::Window::SDLWindow.new(title:, width:, height:, resizable:)
@close_requested = false
end
|
Instance Attribute Details
#native ⇒ Object
Returns the value of attribute native.
6
7
8
|
# File 'lib/stagecraft/window/sdl3.rb', line 6
def native
@native
end
|
Instance Method Details
#close ⇒ Object
34
35
36
|
# File 'lib/stagecraft/window/sdl3.rb', line 34
def close
native.close
end
|
#create_surface(instance) ⇒ Object
16
17
18
|
# File 'lib/stagecraft/window/sdl3.rb', line 16
def create_surface(instance)
native.create_surface(instance)
end
|
#drawable_size ⇒ Object
30
31
32
|
# File 'lib/stagecraft/window/sdl3.rb', line 30
def drawable_size
native.drawable_size
end
|
#poll_events ⇒ Object
20
21
22
23
24
|
# File 'lib/stagecraft/window/sdl3.rb', line 20
def poll_events
events = native.poll_events
events.each { |event| dispatch(event) }
events
end
|
#should_close? ⇒ Boolean
26
27
28
|
# File 'lib/stagecraft/window/sdl3.rb', line 26
def should_close?
@close_requested
end
|