Module: SDL2::Video::Drivers
- Defined in:
- lib/sdl2/video.rb
Overview
Abstract enumeration of SDL’s VideoDrivers concept.
Class Method Summary collapse
-
.[](index) ⇒ Object
Returns the name of the video driver.
-
.each(&block) ⇒ Object
Enumerates the drivers.
-
.lazy(&block) ⇒ Object
Constructs a ?lazy? enumerator.
-
.num ⇒ Object
Returns the number of video drivers available.
Class Method Details
.[](index) ⇒ Object
Returns the name of the video driver
86 87 88 |
# File 'lib/sdl2/video.rb', line 86 def self.[](index) SDL2.get_video_driver(index) end |
.each(&block) ⇒ Object
Enumerates the drivers
91 92 93 |
# File 'lib/sdl2/video.rb', line 91 def self.each(&block) self.lazy(&block) end |
.lazy(&block) ⇒ Object
Constructs a ?lazy? enumerator
96 97 98 |
# File 'lib/sdl2/video.rb', line 96 def self.lazy(&block) self.num.times.lazy.map{|idx|self[idx]}.each(&block) end |
.num ⇒ Object
Returns the number of video drivers available.
81 82 83 |
# File 'lib/sdl2/video.rb', line 81 def self.num SDL2.get_num_video_drivers!() end |