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.
Files changed (88) hide show
  1. data/MANIFEST +22 -2
  2. data/NEWS.en +80 -0
  3. data/NEWS.ja +83 -0
  4. data/README.en +2 -1
  5. data/README.ja +2 -2
  6. data/doc-en/Makefile +18 -0
  7. data/doc-en/cdrom.rsd +417 -0
  8. data/doc-en/collision.rsd +174 -0
  9. data/doc-en/event.rsd +1476 -0
  10. data/doc-en/font.rsd +811 -0
  11. data/doc-en/general.rsd +43 -0
  12. data/doc-en/init.rsd +168 -0
  13. data/doc-en/joystick.rsd +401 -0
  14. data/doc-en/mixer.rsd +869 -0
  15. data/doc-en/mpeg.rsd +585 -0
  16. data/doc-en/opengl.rsd +155 -0
  17. data/doc-en/sdlskk.rsd +472 -0
  18. data/doc-en/time.rsd +46 -0
  19. data/doc-en/video.rsd +2806 -0
  20. data/doc-en/wm.rsd +112 -0
  21. data/doc/Makefile +1 -1
  22. data/doc/cdrom.rsd +3 -3
  23. data/doc/event.rsd +178 -179
  24. data/doc/general.rsd +10 -0
  25. data/doc/init.rsd +2 -2
  26. data/doc/joystick.rsd +29 -5
  27. data/doc/mixer.rsd +20 -0
  28. data/doc/rsd.rb +42 -9
  29. data/doc/sdlskk.rsd +7 -7
  30. data/doc/video.rsd +461 -168
  31. data/doc/wm.rsd +2 -2
  32. data/extconf.rb +1 -8
  33. data/lib/rubysdl_aliases.rb +52 -190
  34. data/lib/rubysdl_compatible_ver1.rb +243 -0
  35. data/lib/sdl.rb +58 -92
  36. data/rubysdl.h +59 -68
  37. data/rubysdl_cdrom.c +125 -102
  38. data/{rubysdl_doc.en.rd → rubysdl_doc_old.en.rd} +3 -2
  39. data/rubysdl_event.c +318 -255
  40. data/rubysdl_event_key.c +299 -287
  41. data/rubysdl_image.c +37 -13
  42. data/rubysdl_joystick.c +180 -67
  43. data/rubysdl_kanji.c +61 -75
  44. data/rubysdl_main.c +65 -138
  45. data/rubysdl_mixer.c +339 -214
  46. data/rubysdl_mouse.c +50 -43
  47. data/rubysdl_opengl.c +31 -28
  48. data/rubysdl_pixel.c +17 -28
  49. data/rubysdl_ref.en.html +5658 -0
  50. data/rubysdl_ref.en.rd +6337 -0
  51. data/rubysdl_ref.html +2253 -1964
  52. data/rubysdl_ref.rd +823 -469
  53. data/rubysdl_rwops.c +9 -6
  54. data/rubysdl_sdlskk.c +137 -165
  55. data/rubysdl_sge_video.c +355 -469
  56. data/rubysdl_smpeg.c +189 -190
  57. data/rubysdl_time.c +1 -1
  58. data/rubysdl_ttf.c +147 -215
  59. data/rubysdl_video.c +486 -405
  60. data/rubysdl_wm.c +30 -30
  61. data/sample/aadraw.rb +9 -9
  62. data/sample/alpha.rb +12 -13
  63. data/sample/alphadraw.rb +10 -10
  64. data/sample/bfont.rb +4 -4
  65. data/sample/cdrom.rb +11 -4
  66. data/sample/collision.rb +20 -20
  67. data/sample/cursor.rb +5 -5
  68. data/sample/ellipses.rb +20 -16
  69. data/sample/event2.rb +11 -9
  70. data/sample/font.rb +4 -4
  71. data/sample/fpstimer.rb +3 -3
  72. data/sample/icon.bmp.gz +0 -0
  73. data/sample/icon.png +0 -0
  74. data/sample/joy2.rb +14 -14
  75. data/sample/kanji.rb +7 -7
  76. data/sample/load_from_io.rb +44 -0
  77. data/sample/movesp.rb +13 -12
  78. data/sample/playmod.rb +2 -3
  79. data/sample/plaympeg.rb +8 -8
  80. data/sample/playwave.rb +5 -6
  81. data/sample/sdlskk.rb +11 -11
  82. data/sample/sgetest.rb +14 -12
  83. data/sample/stetris.rb +12 -13
  84. data/sample/testgl.rb +13 -14
  85. data/sample/testsprite.rb +12 -11
  86. data/sample/transformblit.rb +23 -22
  87. metadata +62 -35
  88. data/rubysdl_event2.c +0 -417
data/rubysdl_wm.c CHANGED
@@ -19,53 +19,53 @@
19
19
  */
20
20
  #include "rubysdl.h"
21
21
 
22
- static VALUE sdl_wm_getCaption(VALUE mod)
22
+ static VALUE WM_s_caption(VALUE mod)
23
23
  {
24
- char *title,*icon;
25
- SDL_WM_GetCaption( &title,&icon );
26
- return rb_ary_new3( 2,rb_str_new2(title),rb_str_new2(icon) );
24
+ char *title, *icon;
25
+
26
+ rb_secure(4);
27
+ SDL_WM_GetCaption(&title, &icon);
28
+ return rb_ary_new3(2, rb_str_new2(title), rb_str_new2(icon));
27
29
  }
28
- static VALUE sdl_wm_setCaption(VALUE mod,VALUE title,VALUE icon)
30
+ static VALUE WM_s_setCaption(VALUE mod, VALUE title, VALUE icon)
29
31
  {
30
- SDL_WM_SetCaption( GETCSTR(title),GETCSTR(icon) );
32
+ rb_secure(4);
33
+ SafeStringValue(title);
34
+ SafeStringValue(icon);
35
+
36
+ SDL_WM_SetCaption(RSTRING_PTR(title), RSTRING_PTR(icon));
31
37
  return Qnil;
32
38
  }
33
- static VALUE sdl_wm_setIcon(VALUE mod,VALUE icon)
39
+ static VALUE WM_s_set_icon(VALUE mod, VALUE icon)
34
40
  {
35
- SDL_Surface *surface;
36
- if( ! rb_obj_is_kind_of(icon,cSurface) )
37
- rb_raise(rb_eArgError,"type mismatch (expected Surface)");
38
- Data_Get_Struct(icon,SDL_Surface,surface);
39
- SDL_WM_SetIcon(surface,NULL);
41
+ rb_secure(4);
42
+ SDL_WM_SetIcon(Get_SDL_Surface(icon), NULL);
40
43
  return Qnil;
41
44
  }
42
- static VALUE sdl_wm_iconifyWindow(VALUE mod)
45
+ static VALUE WM_s_iconify(VALUE mod)
43
46
  {
47
+ rb_secure(4);
44
48
  if( ! SDL_WM_IconifyWindow() )
45
49
  rb_raise( eSDLError,"iconify failed: %s",SDL_GetError() );
46
50
  return Qnil;
47
51
  }
48
52
 
49
- static void defineConstForWM()
50
- {
51
- rb_define_const(mWM,"GRAB_QUERY",INT2NUM(SDL_GRAB_QUERY));
52
- rb_define_const(mWM,"GRAB_OFF",INT2NUM(SDL_GRAB_OFF));
53
- rb_define_const(mWM,"GRAB_ON",INT2NUM(SDL_GRAB_ON));
54
- }
55
-
56
- static VALUE sdl_wm_grabInput(VALUE mod, VALUE flag)
53
+ static VALUE WM_s_grabInput(VALUE mod, VALUE flag)
57
54
  {
58
- return INT2FIX(SDL_WM_GrabInput(flag));
55
+ rb_secure(4);
56
+ return INT2FIX(SDL_WM_GrabInput(flag));
59
57
  }
60
58
 
61
- void init_wm()
59
+ void rubysdl_init_WM(VALUE mSDL)
62
60
  {
63
- mWM=rb_define_module_under(mSDL,"WM");
64
- rb_define_module_function(mWM,"caption",sdl_wm_getCaption,0);
65
- rb_define_module_function(mWM,"setCaption",sdl_wm_setCaption,2);
66
- rb_define_module_function(mWM,"icon=",sdl_wm_setIcon,1);
67
- rb_define_module_function(mWM,"iconify",sdl_wm_iconifyWindow,0);
68
- rb_define_module_function(mWM,"grabInput",sdl_wm_grabInput,1);
61
+ VALUE mWM=rb_define_module_under(mSDL, "WM");
62
+ rb_define_module_function(mWM, "caption", WM_s_caption, 0);
63
+ rb_define_module_function(mWM, "setCaption", WM_s_setCaption, 2);
64
+ rb_define_module_function(mWM, "icon=", WM_s_set_icon, 1);
65
+ rb_define_module_function(mWM, "iconify", WM_s_iconify, 0);
66
+ rb_define_module_function(mWM, "grabInput", WM_s_grabInput, 1);
69
67
 
70
- defineConstForWM();
68
+ rb_define_const(mWM, "GRAB_QUERY", INT2NUM(SDL_GRAB_QUERY));
69
+ rb_define_const(mWM, "GRAB_OFF", INT2NUM(SDL_GRAB_OFF));
70
+ rb_define_const(mWM, "GRAB_ON", INT2NUM(SDL_GRAB_ON));
71
71
  }
data/sample/aadraw.rb CHANGED
@@ -1,21 +1,21 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
5
- SDL::WM::setCaption $0, $0
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+ SDL::WM::set_caption $0, $0
6
6
 
7
- Red=screen.format.mapRGB(255,0,0)
8
- screen.drawAALine(20,20,300,200,Red)
9
- screen.drawAACircle(100,100,50,[87,87,87])
10
- screen.drawAAFilledCircle(300,300,30,Red)
11
- screen.drawAAEllipse(320,240,100,200,[200,255,0])
7
+ Red=screen.format.map_rgb(255,0,0)
8
+ screen.draw_line(20,20,300,200,Red, true)
9
+ screen.draw_circle(100,100,50,[87,87,87], false, true)
10
+ screen.draw_circle(300,300,30,Red, true, true)
11
+ screen.draw_ellipse(320,240,100,200,[200,255,0], false, true)
12
12
 
13
13
  screen.flip
14
14
 
15
15
  while true
16
- while event = SDL::Event2.poll
16
+ while event = SDL::Event.poll
17
17
  case event
18
- when SDL::Event2::KeyDown, SDL::Event2::Quit
18
+ when SDL::Event::KeyDown, SDL::Event::Quit
19
19
  exit
20
20
  end
21
21
  end
data/sample/alpha.rb CHANGED
@@ -1,26 +1,25 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+
6
+ image = SDL::Surface.load_bmp("icon.bmp")
7
+ image.set_color_key( SDL::SRCCOLORKEY ,0)
8
+ image = image.display_format
5
9
 
6
- image = SDL::Surface.loadBMP("icon.bmp")
7
- image.setColorKey( SDL::SRCCOLORKEY ,0)
8
- image = image.displayFormat
9
10
 
10
- event=SDL::Event.new
11
11
  i=0;
12
- while true
13
- if event.poll != 0 then
14
- if event.type==SDL::Event::QUIT then
15
- break
16
- end
17
- if event.type==SDL::Event::KEYDOWN then
12
+ black = screen.format.map_rgb(0,0,0)
13
+ while true
14
+ while event = SDL::Event.poll
15
+ case event
16
+ when SDL::Event::Quit, SDL::Event::KeyDown
18
17
  exit
19
18
  end
20
19
  end
21
- screen.fillRect(0,0,640,480,0)
20
+ screen.fillRect(0,0,640,480,black)
22
21
 
23
- image.setAlpha(SDL::SRCALPHA,i%256)
22
+ image.set_alpha(SDL::SRCALPHA,i%256)
24
23
  screen.put(image,310,195)
25
24
  i+=1
26
25
  screen.flip
data/sample/alphadraw.rb CHANGED
@@ -1,22 +1,22 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
5
- SDL::WM::setCaption $0, $0
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+ SDL::WM::set_caption $0, $0
6
6
 
7
- Red=screen.format.mapRGB(255,0,0)
8
- screen.drawAAFilledCircle(320,240,220,[140,180,0])
9
- screen.drawAALineAlpha(20,20,300,200,Red,rand(64)+128)
10
- screen.drawAACircleAlpha(100,100,50,[87,87,87],rand(64)+128)
11
- screen.drawFilledCircleAlpha(300,170,50,[87,80,0],rand(64)+128)
12
- screen.drawEllipseAlpha(320,240,100,200,[200,255,0],rand(64)+128)
7
+ Red=screen.format.map_rgb(255,0,0)
8
+ screen.draw_circle(320,240,220,[140,180,0], true, true)
9
+ screen.draw_line(20,20,300,200,Red,true, rand(64)+128)
10
+ screen.draw_circle(100,100,50,[87,87,87],false,true,rand(64)+128)
11
+ screen.draw_circle(300,170,50,[87,80,0],true, false, rand(64)+128)
12
+ screen.draw_ellipse(320,240,100,200,[200,255,0],false, false, rand(64)+128)
13
13
 
14
14
  screen.flip
15
15
 
16
16
  while true
17
- while event = SDL::Event2.poll
17
+ while event = SDL::Event.poll
18
18
  case event
19
- when SDL::Event2::KeyDown, SDL::Event2::Quit
19
+ when SDL::Event::KeyDown, SDL::Event::Quit
20
20
  exit
21
21
  end
22
22
  end
data/sample/bfont.rb CHANGED
@@ -1,20 +1,20 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
5
 
6
6
  font = SDL::BMFont.open("font.bmp",SDL::BMFont::TRANSPARENT)
7
7
 
8
8
  y = 0
9
9
 
10
10
  while true
11
- while event = SDL::Event2.poll
11
+ while event = SDL::Event.poll
12
12
  case event
13
- when SDL::Event2::KeyDown, SDL::Event2::Quit
13
+ when SDL::Event::KeyDown, SDL::Event::Quit
14
14
  exit
15
15
  end
16
16
  end
17
- screen.fillRect(0,0,640,480,0)
17
+ screen.fill_rect(0,0,640,480,0)
18
18
 
19
19
  y = (y + 1) % 480
20
20
  font.textout(screen,"BitMapFont Testing..",40,y)
data/sample/cdrom.rb CHANGED
@@ -2,14 +2,21 @@ require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_CDROM )
4
4
 
5
- print SDL::CD.numDrive,"\n"
6
- print SDL::CD.indexName(0),"\n"
5
+ num_drive = SDL::CD.num_drive
6
+ if num_drive == 0
7
+ print "No cdrom drive is detected\n"
8
+ exit
9
+ else
10
+ print "#{num_drive} cdrom drives are detected\n"
11
+ end
12
+
13
+ print SDL::CD.index_name(0),"\n"
7
14
  cd=SDL::CD.open(0)
8
15
  cd.status
9
- print cd.numTracks," ",cd.status, "\n"
16
+ print cd.num_tracks," ",cd.status, "\n"
10
17
 
11
18
  begin
12
- cd.playTracks 1,0,1,0
19
+ cd.play_tracks 1,0,1,0
13
20
  sleep 100
14
21
  ensure
15
22
  cd.stop
data/sample/collision.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
5
- SDL::WM::setCaption('collision.rb','collision.rb icon')
6
- $image = SDL::Surface.loadBMP("icon.bmp")
7
- $image.setColorKey( SDL::SRCCOLORKEY ,0)
8
- $image = $image.displayFormat
9
- $cMap = $image.makeCollisionMap
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+ SDL::WM::set_caption('collision.rb','collision.rb icon')
6
+ $image = SDL::Surface.load_bmp("icon.bmp")
7
+ $image.set_color_key( SDL::SRCCOLORKEY ,0)
8
+ $image = $image.display_format
9
+ $cMap = $image.make_collision_map
10
10
 
11
11
  class Sprite
12
12
 
@@ -21,8 +21,8 @@ class Sprite
21
21
  end
22
22
 
23
23
  def move
24
- @x, @dx = moveCoord(@x, @dx, xMax)
25
- @y, @dy = moveCoord(@y, @dy, yMax)
24
+ @x, @dx = move_coord(@x, @dx, xMax)
25
+ @y, @dy = move_coord(@y, @dy, yMax)
26
26
  end
27
27
 
28
28
  def bounce
@@ -32,16 +32,16 @@ class Sprite
32
32
  end
33
33
 
34
34
  def draw
35
- SDL.blitSurface($image,0,0,$image.w,$image.h,@screen,@x,@y)
35
+ SDL::Surface.blit($image,0,0,$image.w,$image.h,@screen,@x,@y)
36
36
  end
37
37
 
38
- def collidingWith(sprite)
39
- $cMap.collisionCheck(@x, @y, $cMap, sprite.x, sprite.y) != nil
38
+ def collide_with?(sprite)
39
+ $cMap.collision_check(@x, @y, $cMap, sprite.x, sprite.y) != nil
40
40
  end
41
41
 
42
42
  private
43
43
 
44
- def moveCoord(coord, delta, max)
44
+ def move_coord(coord, delta, max)
45
45
  coord += delta
46
46
  if coord >= max then
47
47
  delta *= -1
@@ -64,11 +64,11 @@ class Sprite
64
64
 
65
65
  end
66
66
 
67
- def detectCollisions(sprites)
67
+ def detect_collisions(sprites)
68
68
  collisions = []
69
69
  for i in (0 ... sprites.size - 1) do
70
70
  for j in (i + 1 ... sprites.size) do
71
- if sprites[i].collidingWith(sprites[j])
71
+ if sprites[i].collide_with?(sprites[j])
72
72
  collisions << sprites[i]
73
73
  collisions << sprites[j]
74
74
  end
@@ -79,19 +79,19 @@ end
79
79
 
80
80
  sprites = (1..8).collect {Sprite.new(screen)}
81
81
 
82
-
82
+ background = screen.format.map_rgb(64, 64, 64)
83
83
  while true
84
- while event = SDL::Event2.poll
84
+ while event = SDL::Event.poll
85
85
  case event
86
- when SDL::Event2::KeyDown, SDL::Event2::Quit
86
+ when SDL::Event::KeyDown, SDL::Event::Quit
87
87
  exit
88
88
  end
89
89
  end
90
90
 
91
- screen.fillRect(0,0,640,480,screen.mapRGB(64, 64, 64))
91
+ screen.fill_rect(0,0,640,480,background)
92
92
  sprites.each {|i| i.move}
93
- detectCollisions(sprites).each {|i| i.bounce}
93
+ detect_collisions(sprites).each {|i| i.bounce}
94
94
  sprites.each {|i| i.draw}
95
- screen.updateRect(0,0,0,0)
95
+ screen.update_rect(0,0,0,0)
96
96
  end
97
97
 
data/sample/cursor.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
5
- screen.fillRect 0,0,640,480,[32,240,100]
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+ screen.fill_rect 0,0,640,480,[32,240,100]
6
6
  screen.flip
7
- SDL::WM::setCaption $0,$0
7
+ SDL::WM::set_caption $0,$0
8
8
 
9
- image=SDL::Surface.loadBMP 'cursor.bmp'
10
- SDL::Mouse.setCursor image,image[0,0],image[1,1],image[7,0],543
9
+ image=SDL::Surface.load_bmp 'cursor.bmp'
10
+ SDL::Mouse.set_cursor image,image[0,0],image[1,1],image[7,0],543
11
11
 
12
12
 
13
13
  while true
data/sample/ellipses.rb CHANGED
@@ -3,33 +3,37 @@
3
3
 
4
4
  require 'sdl'
5
5
 
6
- def show(function)
7
- event = SDL::Event.new
8
- screen = SDL::setVideoMode(640, 480, 16, SDL::SWSURFACE|SDL::ANYFORMAT)
6
+ def show(fill)
7
+ screen = SDL::Screen.open(640, 480, 16, SDL::SWSURFACE)
8
+ format = screen.format
9
9
  loop do
10
- color = screen.mapRGB(rand(256),rand(256),rand(256))
10
+ color = format.map_rgb(rand(256),rand(256),rand(256))
11
11
  x = rand(screen.w)
12
12
  y = rand(screen.h)
13
13
  xr = rand(80)
14
14
  yr = rand(80)
15
- eval("screen.#{function}(x, y, xr, yr, color)")
16
- if event.poll != 0 then
17
- case event.type
18
- when SDL::Event::QUIT
15
+ screen.draw_ellipse(x, y, xr, yr, color, fill)
16
+ while event = SDL::Event.poll
17
+ case event
18
+ when SDL::Event::Quit
19
19
  exit
20
- when SDL::Event::MOUSEBUTTONDOWN
21
- break
22
- when SDL::Event::KEYDOWN
23
- exit if event.keySym == SDL::Key::ESCAPE
24
- break
20
+ when SDL::Event::KeyDown
21
+ if event.sym == SDL::Key::ESCAPE
22
+ exit
23
+ else
24
+ return
25
+ end
26
+ when SDL::Event::MouseButtonDown
27
+ return
25
28
  end
26
29
  end
27
- SDL::Key.scan
28
30
  screen.updateRect(0, 0, 0, 0)
31
+ sleep 0.05
29
32
  end
33
+ screen.destroy
30
34
  end
31
35
 
32
36
  srand
33
37
  SDL.init SDL::INIT_VIDEO
34
- show("drawEllipse")
35
- show("drawFilledEllipse")
38
+ show(false)
39
+ show(true)
data/sample/event2.rb CHANGED
@@ -1,32 +1,34 @@
1
1
  require 'sdl'
2
2
 
3
3
  SDL.init( SDL::INIT_VIDEO )
4
- screen = SDL::setVideoMode(640,480,16,SDL::SWSURFACE)
5
- SDL::WM::setCaption $0,$0
4
+ screen = SDL::Screen.open(640,480,16,SDL::SWSURFACE)
5
+ SDL::WM::set_caption $0,$0
6
6
 
7
7
  loop do
8
- if event=SDL::Event2.poll then
8
+ while event=SDL::Event.poll
9
9
  case event
10
- when SDL::Event2::Active
10
+ when SDL::Event::Active
11
11
  print "Active ", (event.gain)?"gain":"lost","\n"
12
- when SDL::Event2::KeyDown
12
+ when SDL::Event::KeyDown
13
13
  print "KeyDown sym:#{event.sym} mod:#{event.mod}","\n"
14
14
  if event.sym==SDL::Key::A then
15
- e=SDL::Event2::KeyDown.new
15
+ e=SDL::Event::KeyDown.new
16
16
  e.sym=3333
17
17
  e.mod=3333
18
18
  e.press=true
19
19
  e.unicode=200
20
- SDL::Event2.push(e)
20
+ SDL::Event.push(e)
21
21
  end
22
- when SDL::Event2::KeyUp
22
+ when SDL::Event::KeyUp
23
23
  print "KeyUp sym:#{event.sym} mod:#{event.mod}","\n"
24
24
 
25
- when SDL::Event2::Quit
25
+ when SDL::Event::Quit
26
26
  exit
27
27
 
28
28
  end
29
29
  end
30
+
31
+ sleep 0.05
30
32
  end
31
33
 
32
34