rubygame 2.5.3 → 2.6.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/CREDITS +6 -4
  2. data/NEWS +79 -0
  3. data/README +55 -72
  4. data/ROADMAP +20 -13
  5. data/doc/custom_sdl_load_paths.rdoc +79 -0
  6. data/doc/getting_started.rdoc +65 -36
  7. data/doc/keyboard_symbols.rdoc +243 -0
  8. data/doc/macosx_install.rdoc +49 -35
  9. data/doc/windows_install.rdoc +36 -108
  10. data/lib/rubygame.rb +62 -24
  11. data/lib/rubygame/audio.rb +147 -0
  12. data/lib/rubygame/clock.rb +164 -1
  13. data/lib/rubygame/color.rb +40 -7
  14. data/lib/rubygame/color/models/hsl.rb +1 -1
  15. data/lib/rubygame/color/models/hsv.rb +1 -1
  16. data/lib/rubygame/color/models/rgb.rb +1 -1
  17. data/lib/rubygame/color/palettes/css.rb +1 -3
  18. data/lib/rubygame/color/palettes/x11.rb +1 -2
  19. data/lib/rubygame/constants.rb +297 -0
  20. data/lib/rubygame/deprecated_mixer.rb +555 -0
  21. data/lib/rubygame/event.rb +122 -6
  22. data/lib/rubygame/event_handler.rb +3 -1
  23. data/lib/rubygame/event_hook.rb +6 -2
  24. data/lib/rubygame/event_triggers.rb +1 -1
  25. data/lib/rubygame/events.rb +416 -1
  26. data/lib/rubygame/ftor.rb +1 -7
  27. data/lib/rubygame/gfx.rb +583 -0
  28. data/lib/rubygame/gl.rb +107 -0
  29. data/lib/rubygame/image.rb +140 -0
  30. data/lib/rubygame/joystick.rb +184 -0
  31. data/lib/rubygame/main.rb +82 -0
  32. data/lib/rubygame/mediabag.rb +1 -1
  33. data/lib/rubygame/mixer.rb +30 -0
  34. data/lib/rubygame/music.rb +493 -0
  35. data/lib/rubygame/queue.rb +3 -1
  36. data/lib/rubygame/rect.rb +9 -9
  37. data/lib/rubygame/screen.rb +357 -0
  38. data/lib/rubygame/shared.rb +40 -4
  39. data/lib/rubygame/sound.rb +428 -0
  40. data/lib/rubygame/surface.rb +626 -0
  41. data/lib/rubygame/ttf.rb +311 -0
  42. data/samples/FreeSans.ttf +0 -0
  43. data/samples/README +6 -5
  44. data/samples/demo_draw.rb +1 -1
  45. data/samples/demo_gl.rb +3 -1
  46. data/samples/demo_gl_tex.rb +4 -2
  47. data/samples/demo_rubygame.rb +114 -105
  48. data/samples/demo_sfont.rb +1 -1
  49. data/samples/demo_ttf.rb +3 -1
  50. data/samples/demo_utf8.rb +1 -1
  51. data/samples/image_viewer.rb +118 -0
  52. data/samples/load_and_blit.rb +1 -1
  53. data/samples/rubygame.png +0 -0
  54. metadata +34 -40
  55. data/Rakefile +0 -537
  56. data/doc/extended_readme.rdoc +0 -49
  57. data/ext/body/rubygame_body.so +0 -0
  58. data/ext/rubygame/rubygame_clock.c +0 -301
  59. data/ext/rubygame/rubygame_clock.h +0 -32
  60. data/ext/rubygame/rubygame_event.c +0 -760
  61. data/ext/rubygame/rubygame_event.h +0 -48
  62. data/ext/rubygame/rubygame_event2.c +0 -661
  63. data/ext/rubygame/rubygame_event2.h +0 -29
  64. data/ext/rubygame/rubygame_gfx.c +0 -942
  65. data/ext/rubygame/rubygame_gfx.h +0 -101
  66. data/ext/rubygame/rubygame_gl.c +0 -154
  67. data/ext/rubygame/rubygame_gl.h +0 -32
  68. data/ext/rubygame/rubygame_image.c +0 -252
  69. data/ext/rubygame/rubygame_image.h +0 -41
  70. data/ext/rubygame/rubygame_joystick.c +0 -336
  71. data/ext/rubygame/rubygame_joystick.h +0 -41
  72. data/ext/rubygame/rubygame_main.c +0 -158
  73. data/ext/rubygame/rubygame_main.h +0 -36
  74. data/ext/rubygame/rubygame_mixer.c +0 -1024
  75. data/ext/rubygame/rubygame_mixer.h +0 -36
  76. data/ext/rubygame/rubygame_music.c +0 -1017
  77. data/ext/rubygame/rubygame_music.h +0 -29
  78. data/ext/rubygame/rubygame_screen.c +0 -572
  79. data/ext/rubygame/rubygame_screen.h +0 -45
  80. data/ext/rubygame/rubygame_shared.c +0 -269
  81. data/ext/rubygame/rubygame_shared.h +0 -69
  82. data/ext/rubygame/rubygame_sound.c +0 -863
  83. data/ext/rubygame/rubygame_sound.h +0 -29
  84. data/ext/rubygame/rubygame_surface.c +0 -1153
  85. data/ext/rubygame/rubygame_surface.h +0 -62
  86. data/ext/rubygame/rubygame_ttf.c +0 -599
  87. data/ext/rubygame/rubygame_ttf.h +0 -69
  88. data/samples/keys.rb +0 -52
@@ -1,69 +0,0 @@
1
- /*
2
- * Rubygame -- Ruby code and bindings to SDL to facilitate game creation
3
- * Copyright (C) 2004-2007 John Croisant
4
- *
5
- * This library is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU Lesser General Public
7
- * License as published by the Free Software Foundation; either
8
- * version 2.1 of the License, or (at your option) any later version.
9
- *
10
- * This library is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this library; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
- *
19
- */
20
-
21
- #ifndef _RUBYGAME_TTF_H
22
- #define _RUBYGAME_TTF_H
23
-
24
- #include "SDL_ttf.h"
25
-
26
- #ifndef SDL_TTF_MAJOR_VERSION
27
- #define SDL_TTF_MAJOR_VERSION 0
28
- #endif
29
-
30
- #ifndef SDL_TTF_MINOR_VERSION
31
- #define SDL_TTF_MINOR_VERSION 0
32
- #endif
33
-
34
- #ifndef SDL_TTF_PATCHLEVEL
35
- #define SDL_TTF_PATCHLEVEL 0
36
- #endif
37
-
38
- extern void Init_rubygame_ttf();
39
-
40
- extern VALUE cTTF;
41
-
42
- extern VALUE rbgm_ttf_setup(VALUE);
43
- extern VALUE rbgm_ttf_quit(VALUE);
44
- extern VALUE rbgm_ttf_new(VALUE, VALUE, VALUE);
45
- extern VALUE rbgm_ttf_initialize(int, VALUE*, VALUE);
46
-
47
- extern VALUE rbgm_ttf_getbold(VALUE);
48
- extern VALUE rbgm_ttf_setbold(VALUE, VALUE);
49
-
50
- extern VALUE rbgm_ttf_getitalic(VALUE);
51
- extern VALUE rbgm_ttf_setitalic(VALUE, VALUE);
52
-
53
- extern VALUE rbgm_ttf_getunderline(VALUE);
54
- extern VALUE rbgm_ttf_setunderline(VALUE, VALUE);
55
-
56
- extern VALUE rbgm_ttf_height(VALUE);
57
- extern VALUE rbgm_ttf_ascent(VALUE);
58
- extern VALUE rbgm_ttf_descent(VALUE);
59
- extern VALUE rbgm_ttf_lineskip(VALUE);
60
-
61
- extern VALUE rbgm_ttf_sizetext(VALUE, VALUE);
62
- extern VALUE rbgm_ttf_size_utf8(VALUE, VALUE);
63
- extern VALUE rbgm_ttf_size_unicode(VALUE, VALUE);
64
-
65
- extern VALUE rbgm_ttf_render(int, VALUE*, VALUE);
66
- extern VALUE rbgm_ttf_render_utf8(int , VALUE*, VALUE);
67
- extern VALUE rbgm_ttf_render_unicode(int , VALUE*, VALUE);
68
-
69
- #endif
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Quick and dirty test app to print out info about keys that are pressed.
4
-
5
-
6
- require "rubygame"
7
- include Rubygame
8
-
9
-
10
- def setup
11
- Rubygame.init
12
-
13
- $queue = EventQueue.new
14
- $queue.enable_new_style_events
15
-
16
- $screen = Screen.open([640,480])
17
-
18
- # We'll store the last $buffer_maxlen lines of the text buffer here.
19
- $buffer = []
20
- $buffer_maxlen = 20
21
-
22
- # Load the font
23
- TTF.setup
24
- ttf_file = File.join( File.dirname(__FILE__), "FreeSans.ttf" )
25
-
26
- $font_size = 24
27
- $font = TTF.new( ttf_file, $font_size )
28
- end
29
-
30
-
31
- def String.pad_to( length, padding=" " )
32
- extra = length < self.length ? length - self.length : 0
33
- return self + padding * extra
34
- end
35
-
36
- def format_event( event )
37
- klass = (event.class.name+":").pad_to(7)
38
-
39
- end
40
-
41
-
42
- def add_to_buffer( text )
43
- surface = $font.render_unicode(text, true, :white)
44
- $buffer.push( text )
45
- $buffer.shift if $buffer.length > $buffer_maxlen
46
- end
47
-
48
-
49
- def redraw_buffer
50
- $screen.fill( :black )
51
-
52
- end