rubysdl 1.3.1 → 2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MANIFEST +22 -2
- data/NEWS.en +80 -0
- data/NEWS.ja +83 -0
- data/README.en +2 -1
- data/README.ja +2 -2
- data/doc-en/Makefile +18 -0
- data/doc-en/cdrom.rsd +417 -0
- data/doc-en/collision.rsd +174 -0
- data/doc-en/event.rsd +1476 -0
- data/doc-en/font.rsd +811 -0
- data/doc-en/general.rsd +43 -0
- data/doc-en/init.rsd +168 -0
- data/doc-en/joystick.rsd +401 -0
- data/doc-en/mixer.rsd +869 -0
- data/doc-en/mpeg.rsd +585 -0
- data/doc-en/opengl.rsd +155 -0
- data/doc-en/sdlskk.rsd +472 -0
- data/doc-en/time.rsd +46 -0
- data/doc-en/video.rsd +2806 -0
- data/doc-en/wm.rsd +112 -0
- data/doc/Makefile +1 -1
- data/doc/cdrom.rsd +3 -3
- data/doc/event.rsd +178 -179
- data/doc/general.rsd +10 -0
- data/doc/init.rsd +2 -2
- data/doc/joystick.rsd +29 -5
- data/doc/mixer.rsd +20 -0
- data/doc/rsd.rb +42 -9
- data/doc/sdlskk.rsd +7 -7
- data/doc/video.rsd +461 -168
- data/doc/wm.rsd +2 -2
- data/extconf.rb +1 -8
- data/lib/rubysdl_aliases.rb +52 -190
- data/lib/rubysdl_compatible_ver1.rb +243 -0
- data/lib/sdl.rb +58 -92
- data/rubysdl.h +59 -68
- data/rubysdl_cdrom.c +125 -102
- data/{rubysdl_doc.en.rd → rubysdl_doc_old.en.rd} +3 -2
- data/rubysdl_event.c +318 -255
- data/rubysdl_event_key.c +299 -287
- data/rubysdl_image.c +37 -13
- data/rubysdl_joystick.c +180 -67
- data/rubysdl_kanji.c +61 -75
- data/rubysdl_main.c +65 -138
- data/rubysdl_mixer.c +339 -214
- data/rubysdl_mouse.c +50 -43
- data/rubysdl_opengl.c +31 -28
- data/rubysdl_pixel.c +17 -28
- data/rubysdl_ref.en.html +5658 -0
- data/rubysdl_ref.en.rd +6337 -0
- data/rubysdl_ref.html +2253 -1964
- data/rubysdl_ref.rd +823 -469
- data/rubysdl_rwops.c +9 -6
- data/rubysdl_sdlskk.c +137 -165
- data/rubysdl_sge_video.c +355 -469
- data/rubysdl_smpeg.c +189 -190
- data/rubysdl_time.c +1 -1
- data/rubysdl_ttf.c +147 -215
- data/rubysdl_video.c +486 -405
- data/rubysdl_wm.c +30 -30
- data/sample/aadraw.rb +9 -9
- data/sample/alpha.rb +12 -13
- data/sample/alphadraw.rb +10 -10
- data/sample/bfont.rb +4 -4
- data/sample/cdrom.rb +11 -4
- data/sample/collision.rb +20 -20
- data/sample/cursor.rb +5 -5
- data/sample/ellipses.rb +20 -16
- data/sample/event2.rb +11 -9
- data/sample/font.rb +4 -4
- data/sample/fpstimer.rb +3 -3
- data/sample/icon.bmp.gz +0 -0
- data/sample/icon.png +0 -0
- data/sample/joy2.rb +14 -14
- data/sample/kanji.rb +7 -7
- data/sample/load_from_io.rb +44 -0
- data/sample/movesp.rb +13 -12
- data/sample/playmod.rb +2 -3
- data/sample/plaympeg.rb +8 -8
- data/sample/playwave.rb +5 -6
- data/sample/sdlskk.rb +11 -11
- data/sample/sgetest.rb +14 -12
- data/sample/stetris.rb +12 -13
- data/sample/testgl.rb +13 -14
- data/sample/testsprite.rb +12 -11
- data/sample/transformblit.rb +23 -22
- metadata +62 -35
- data/rubysdl_event2.c +0 -417
data/sample/font.rb
CHANGED
@@ -2,19 +2,19 @@ require 'sdl'
|
|
2
2
|
|
3
3
|
SDL.init( SDL::INIT_VIDEO )
|
4
4
|
|
5
|
-
screen = SDL::
|
6
|
-
SDL::WM::
|
5
|
+
screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
|
6
|
+
SDL::WM::set_caption($0,$0)
|
7
7
|
|
8
8
|
SDL::TTF.init
|
9
9
|
|
10
10
|
font = SDL::TTF.open('sample.ttf',24)
|
11
11
|
font.style = SDL::TTF::STYLE_NORMAL
|
12
12
|
|
13
|
-
font.
|
13
|
+
font.draw_solid_utf8(screen,'test SDL_ttf',300,150,255,255,255)
|
14
14
|
|
15
15
|
screen.flip
|
16
16
|
|
17
|
-
|
17
|
+
loop do
|
18
18
|
while event = SDL::Event2.poll
|
19
19
|
case event
|
20
20
|
when SDL::Event2::KeyDown, SDL::Event2::Quit
|
data/sample/fpstimer.rb
CHANGED
@@ -56,7 +56,7 @@ class FPSTimerSample
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def get_ticks
|
59
|
-
SDL.
|
59
|
+
SDL.get_ticks / 1000.0
|
60
60
|
end
|
61
61
|
|
62
62
|
def calc_real_fps
|
@@ -117,7 +117,7 @@ class FPSTimerLight
|
|
117
117
|
|
118
118
|
private
|
119
119
|
def get_ticks
|
120
|
-
SDL.
|
120
|
+
SDL.get_ticks * N
|
121
121
|
end
|
122
122
|
|
123
123
|
def wait(nxt)
|
@@ -163,7 +163,7 @@ if __FILE__ == $0
|
|
163
163
|
log = []
|
164
164
|
|
165
165
|
timer.reset
|
166
|
-
old = SDL.
|
166
|
+
old = SDL.get_ticks
|
167
167
|
300.times do
|
168
168
|
sleep 0.005 if rand(5) == 0
|
169
169
|
timer.wait_frame do
|
data/sample/icon.bmp.gz
ADDED
Binary file
|
data/sample/icon.png
ADDED
Binary file
|
data/sample/joy2.rb
CHANGED
@@ -10,40 +10,40 @@ White = [255,255,255]
|
|
10
10
|
|
11
11
|
def print_joystick_info
|
12
12
|
for i in 0..SDL::Joystick.num-1
|
13
|
-
print i,":",SDL::Joystick.
|
13
|
+
print i,":",SDL::Joystick.index_name(0),"\n"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def display_button_state ( screen, joy )
|
18
|
-
for i in 0..joy.
|
18
|
+
for i in 0..joy.num_buttons-1
|
19
19
|
if joy.button(i) then
|
20
|
-
screen.
|
20
|
+
screen.fill_rect( i*30+30, 50, 10, 10, [0,0,128] )
|
21
21
|
else
|
22
|
-
screen.
|
22
|
+
screen.fill_rect( i*30+30, 50, 10, 10, White )
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
def display_hat_state ( screen, joy )
|
28
28
|
# display the state of only first hat
|
29
|
-
if joy.
|
29
|
+
if joy.num_hats > 0 then
|
30
30
|
x = y = 0
|
31
31
|
x = 1 if ( joy.hat(0) & SDL::Joystick::HAT_RIGHT ) != 0
|
32
32
|
x = -1 if ( joy.hat(0) & SDL::Joystick::HAT_LEFT ) != 0
|
33
33
|
y = 1 if ( joy.hat(0) & SDL::Joystick::HAT_DOWN ) != 0
|
34
34
|
y = -1 if ( joy.hat(0) & SDL::Joystick::HAT_UP ) != 0
|
35
|
-
screen.
|
35
|
+
screen.fill_rect( 450 + x*40, 200 + y*40, 10, 10, White )
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
def display_axis_state ( screen, joy )
|
40
|
-
for i in 0..joy.
|
41
|
-
screen.
|
40
|
+
for i in 0..joy.num_axes-1
|
41
|
+
screen.fill_rect( i*30+130, joy.axis(i)*100/32768+200, 20, 20, White )
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
SDL.init( SDL::INIT_VIDEO|SDL::INIT_JOYSTICK )
|
46
|
-
screen = SDL::
|
46
|
+
screen = SDL::Screen.open(640, 480, 16, SDL::SWSURFACE)
|
47
47
|
|
48
48
|
if SDL::Joystick.num == 0 then
|
49
49
|
print "No joystick available\n"
|
@@ -66,16 +66,16 @@ joy=SDL::Joystick.open(joynum)
|
|
66
66
|
|
67
67
|
while true
|
68
68
|
|
69
|
-
while event = SDL::
|
69
|
+
while event = SDL::Event.poll
|
70
70
|
case event
|
71
|
-
when SDL::
|
71
|
+
when SDL::Event::KeyDown, SDL::Event::Quit
|
72
72
|
exit
|
73
73
|
end
|
74
74
|
end
|
75
|
-
SDL::Joystick.
|
76
|
-
screen.
|
75
|
+
SDL::Joystick.update_all
|
76
|
+
screen.fill_rect(0,0,640,480,[0,0,0])
|
77
77
|
display_button_state screen, joy
|
78
78
|
display_hat_state screen, joy
|
79
79
|
display_axis_state screen, joy
|
80
|
-
screen.
|
80
|
+
screen.update_rect(0, 0, 0, 0)
|
81
81
|
end
|
data/sample/kanji.rb
CHANGED
@@ -7,30 +7,30 @@
|
|
7
7
|
require 'sdl'
|
8
8
|
|
9
9
|
SDL.init( SDL::INIT_VIDEO )
|
10
|
-
screen = SDL::
|
10
|
+
screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
|
11
11
|
|
12
12
|
font = SDL::Kanji.open("8x16.bdf",16)
|
13
13
|
font.add("jiskan16.bdf")
|
14
|
-
font.
|
14
|
+
font.set_coding_system(SDL::Kanji::EUC)
|
15
15
|
|
16
16
|
y = 0
|
17
17
|
x = 0
|
18
18
|
|
19
19
|
while true
|
20
|
-
while event = SDL::
|
20
|
+
while event = SDL::Event.poll
|
21
21
|
case event
|
22
|
-
when SDL::
|
22
|
+
when SDL::Event::KeyDown, SDL::Event::Quit
|
23
23
|
exit
|
24
24
|
end
|
25
25
|
end
|
26
|
-
screen.
|
26
|
+
screen.fill_rect(0,0,640,480,0)
|
27
27
|
|
28
28
|
y = (y + 1) % 480
|
29
29
|
x = (x + 1) % 640
|
30
30
|
|
31
31
|
font.put(screen,"SDL Kanji�Υƥ�����",40,y,128,128,0)
|
32
|
-
font.
|
32
|
+
font.put_tate(screen,"�Ľ�Ǥ��ޤ���",x,60,128,128,0)
|
33
33
|
|
34
|
-
screen.
|
34
|
+
screen.update_rect(0,0,0,0)
|
35
35
|
sleep 0.005
|
36
36
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Test for rwops
|
3
|
+
#
|
4
|
+
# This sample needs
|
5
|
+
# track01.ogg: Ogg Vorbis file
|
6
|
+
|
7
|
+
require 'sdl'
|
8
|
+
require 'stringio'
|
9
|
+
require 'zlib'
|
10
|
+
|
11
|
+
SDL.init( SDL::INIT_VIDEO|SDL::INIT_AUDIO )
|
12
|
+
SDL::Mixer.open(22050)
|
13
|
+
|
14
|
+
screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
|
15
|
+
SDL::WM::setCaption('from_str.rb','from_str.rb')
|
16
|
+
|
17
|
+
str = File.read("icon.bmp")
|
18
|
+
img = SDL::Surface.loadBMPFromIO(StringIO.new(str))
|
19
|
+
img2 = File.open("icon.bmp"){|f| SDL::Surface.loadBMPFromIO(f) }
|
20
|
+
img3 = Zlib::GzipReader.open("icon.bmp.gz"){|f| SDL::Surface.loadBMPFromIO(f) }
|
21
|
+
img4 = File.open("icon.png"){|f| SDL::Surface.loadFromIO(f) }
|
22
|
+
|
23
|
+
mus = SDL::Mixer::Music.loadFromString(File.read("track01.ogg"))
|
24
|
+
wav = File.open('sample.wav'){|f| SDL::Mixer::Wave.loadFromIO(f) }
|
25
|
+
|
26
|
+
SDL.blitSurface(img,0,0,32,32,screen,100,100)
|
27
|
+
SDL.blitSurface(img2,0,0,32,32,screen,200,100)
|
28
|
+
SDL.blitSurface(img3,0,0,32,32,screen,300,100)
|
29
|
+
SDL.blitSurface(img4,0,0,32,32,screen,400,100)
|
30
|
+
screen.updateRect(0, 0, 0, 0)
|
31
|
+
|
32
|
+
SDL::Mixer.playMusic(mus, -1)
|
33
|
+
SDL::Mixer.playChannel(0, wav, 0)
|
34
|
+
|
35
|
+
while true
|
36
|
+
while event = SDL::Event2.poll
|
37
|
+
case event
|
38
|
+
when SDL::Event2::KeyDown, SDL::Event2::Quit
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
sleep 0.1
|
44
|
+
end
|
data/sample/movesp.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'sdl'
|
2
2
|
|
3
|
-
SDL.init(
|
3
|
+
SDL.init(SDL::INIT_VIDEO)
|
4
4
|
|
5
|
-
screen = SDL::
|
5
|
+
screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
|
6
6
|
|
7
|
-
image = SDL::Surface.
|
8
|
-
image.
|
9
|
-
$image = image.
|
7
|
+
image = SDL::Surface.load_bmp("icon.bmp")
|
8
|
+
image.set_color_key( SDL::SRCCOLORKEY || SDL::RLEACCEL ,0)
|
9
|
+
$image = image.display_format
|
10
10
|
|
11
11
|
|
12
12
|
class Sprite
|
@@ -40,7 +40,7 @@ class Sprite
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def draw(screen)
|
43
|
-
SDL.
|
43
|
+
SDL::Surface.blit($image,0,0,32,32,screen,@x,@y)
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
@@ -64,30 +64,31 @@ class MovableSp
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def draw(screen)
|
67
|
-
SDL.
|
67
|
+
SDL::Surface.blit($image,0,0,32,32,screen,300+@lr*50,200+@ud*50)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
71
|
sprites << MovableSp.new
|
72
|
+
black = screen.format.map_rgb(0, 0, 0)
|
72
73
|
|
73
74
|
while true
|
74
|
-
while event = SDL::
|
75
|
+
while event = SDL::Event.poll
|
75
76
|
case event
|
76
|
-
when SDL::
|
77
|
+
when SDL::Event::Quit
|
77
78
|
exit
|
78
|
-
when SDL::
|
79
|
+
when SDL::Event::KeyDown
|
79
80
|
exit if event.sym == SDL::Key::ESCAPE
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
83
|
-
screen.
|
84
|
+
screen.fill_rect(0,0,640,480,black)
|
84
85
|
SDL::Key.scan
|
85
86
|
|
86
87
|
sprites.each {|i|
|
87
88
|
i.move
|
88
89
|
i.draw(screen)
|
89
90
|
}
|
90
|
-
screen.
|
91
|
+
screen.update_rect(0,0,0,0)
|
91
92
|
end
|
92
93
|
|
93
94
|
|
data/sample/playmod.rb
CHANGED
@@ -4,11 +4,10 @@ require 'sdl'
|
|
4
4
|
SDL::init(SDL::INIT_AUDIO)
|
5
5
|
|
6
6
|
SDL::Mixer.open(22050)
|
7
|
-
SDL::Mixer::playMusic?
|
8
7
|
music = SDL::Mixer::Music.load("sample.it")
|
9
8
|
|
10
|
-
SDL::Mixer.
|
9
|
+
SDL::Mixer.play_music(music,0)
|
11
10
|
|
12
|
-
while SDL::Mixer::
|
11
|
+
while SDL::Mixer::play_music?
|
13
12
|
sleep 1
|
14
13
|
end
|
data/sample/plaympeg.rb
CHANGED
@@ -4,7 +4,7 @@ require 'sdl'
|
|
4
4
|
SDL.init( SDL::INIT_VIDEO|SDL::INIT_AUDIO )
|
5
5
|
SDL::Mixer.open
|
6
6
|
|
7
|
-
screen = SDL.
|
7
|
+
screen = SDL::Screen.open( 320, 240, 16, SDL::SWSURFACE )
|
8
8
|
|
9
9
|
mpeg = SDL::MPEG.load( 'sample.mpg' )
|
10
10
|
|
@@ -12,20 +12,20 @@ info = mpeg.info
|
|
12
12
|
|
13
13
|
p(info)
|
14
14
|
|
15
|
-
mpeg.
|
16
|
-
mpeg.
|
15
|
+
mpeg.enable_audio true
|
16
|
+
mpeg.enable_video true
|
17
17
|
|
18
|
-
mpeg.
|
19
|
-
mpeg.
|
18
|
+
mpeg.set_display(screen)
|
19
|
+
mpeg.set_display_region( 0, 0, screen.w, screen.h )
|
20
20
|
mpeg.play
|
21
21
|
|
22
22
|
loop do
|
23
23
|
|
24
|
-
case event = SDL::
|
25
|
-
when SDL::
|
24
|
+
case event = SDL::Event.poll
|
25
|
+
when SDL::Event::Quit
|
26
26
|
mpeg.stop
|
27
27
|
exit
|
28
|
-
when SDL::
|
28
|
+
when SDL::Event::KeyDown
|
29
29
|
case event.sym
|
30
30
|
when SDL::Key::S
|
31
31
|
mpeg.stop
|
data/sample/playwave.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
# This sample needs a wave file `sample.wav', please prepare.
|
2
2
|
require 'sdl'
|
3
3
|
|
4
|
-
SDL::init(SDL::INIT_AUDIO
|
5
|
-
SDL.setVideoMode(640,480,16,SDL::SWSURFACE)
|
4
|
+
SDL::init(SDL::INIT_AUDIO)
|
6
5
|
|
7
|
-
SDL::Mixer.open
|
8
|
-
wave=SDL::Mixer::Wave.load("sample.wav")
|
6
|
+
SDL::Mixer.open(22050, SDL::Mixer::DEFAULT_FORMAT, 2, 512)
|
7
|
+
wave = SDL::Mixer::Wave.load("sample.wav")
|
9
8
|
|
10
|
-
SDL::Mixer.
|
9
|
+
SDL::Mixer.play_channel(0, wave, 0)
|
11
10
|
|
12
|
-
while SDL::Mixer
|
11
|
+
while SDL::Mixer.play?(0)
|
13
12
|
sleep 1
|
14
13
|
end
|
15
14
|
|
data/sample/sdlskk.rb
CHANGED
@@ -17,7 +17,7 @@ use_minibuffer = (ARGV[0]=='-m')
|
|
17
17
|
|
18
18
|
SDL.init( SDL::INIT_VIDEO )
|
19
19
|
SDL::TTF.init
|
20
|
-
SDL::
|
20
|
+
SDL::Event.enableUNICODE
|
21
21
|
|
22
22
|
font = SDL::TTF.open( 'nihongo.ttf', 14 )
|
23
23
|
|
@@ -29,17 +29,17 @@ bind.set_default_key
|
|
29
29
|
|
30
30
|
context = SDL::SKK::Context.new( dict, table, bind, use_minibuffer )
|
31
31
|
|
32
|
-
screen = SDL::
|
33
|
-
SDL::WM.
|
32
|
+
screen = SDL::Screen.open( 640, 480, 16, SDL::SWSURFACE )
|
33
|
+
SDL::WM.set_caption( $0, $0 )
|
34
34
|
|
35
|
-
BLACK = screen.
|
35
|
+
BLACK = screen.format.map_rgb( 0, 0, 0 )
|
36
36
|
loop do
|
37
37
|
|
38
|
-
while event = SDL::
|
38
|
+
while event = SDL::Event.poll do
|
39
39
|
case event
|
40
|
-
when SDL::
|
40
|
+
when SDL::Event::Quit
|
41
41
|
exit
|
42
|
-
when SDL::
|
42
|
+
when SDL::Event::KeyDown
|
43
43
|
if event.sym == SDL::Key::ESCAPE then
|
44
44
|
exit
|
45
45
|
end
|
@@ -53,17 +53,17 @@ loop do
|
|
53
53
|
|
54
54
|
text_surface = context.render_str( font, 255, 0, 255 )
|
55
55
|
|
56
|
-
screen.
|
57
|
-
SDL.
|
56
|
+
screen.fill_rect( 0, 0, 640, 480, BLACK )
|
57
|
+
SDL::Surface.blit( text_surface, 0, 0, 0, 0, screen, 0, 0 )
|
58
58
|
|
59
59
|
if use_minibuffer then
|
60
60
|
minibuffer_surface = context.render_minibuffer_str( font, 255, 0, 255 )
|
61
61
|
if minibuffer_surface then
|
62
|
-
SDL.
|
62
|
+
SDL::Surface.blit( minibuffer_surface, 0, 0, 0, 0, screen, 0, 40 )
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
screen.
|
66
|
+
screen.update_rect( 0, 0, 0, 0 )
|
67
67
|
|
68
68
|
sleep 0.05
|
69
69
|
|
data/sample/sgetest.rb
CHANGED
@@ -1,28 +1,30 @@
|
|
1
1
|
require 'sdl'
|
2
2
|
|
3
3
|
SDL.init( SDL::INIT_VIDEO )
|
4
|
-
screen = SDL::
|
5
|
-
SDL::WM
|
4
|
+
screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
|
5
|
+
SDL::WM.set_caption $0, $0
|
6
6
|
|
7
|
+
format = screen.format
|
7
8
|
# draw red pixel at (200,200)
|
8
|
-
screen[200,200]=
|
9
|
+
screen[200,200]= format.map_rgb(255,0,0)
|
9
10
|
# draw green pixel at (250,200)
|
10
|
-
screen[250,200]=
|
11
|
+
screen[250,200]= format.map_rgb(0,255,0)
|
11
12
|
# draw blue pixel at (200,200)
|
12
|
-
screen[300,200]=
|
13
|
+
screen[300,200]= format.map_rgb(0,0,255)
|
13
14
|
|
14
|
-
Red=
|
15
|
-
screen.
|
16
|
-
screen.
|
17
|
-
screen.
|
18
|
-
screen.
|
15
|
+
Red=format.map_rgb(255,0,0)
|
16
|
+
screen.draw_line(20,20,300,200,Red)
|
17
|
+
screen.draw_rect(49,59,80,80,Red)
|
18
|
+
screen.draw_circle(100,100,50,[87,87,87])
|
19
|
+
screen.draw_circle(300,300,30,Red, true)
|
20
|
+
screen.draw_circle(230, 300, 30, Red, true, true)
|
19
21
|
|
20
22
|
screen.flip
|
21
23
|
|
22
24
|
while true
|
23
|
-
while event = SDL::
|
25
|
+
while event = SDL::Event.poll
|
24
26
|
case event
|
25
|
-
when SDL::
|
27
|
+
when SDL::Event::KeyDown, SDL::Event::Quit
|
26
28
|
exit
|
27
29
|
end
|
28
30
|
end
|