rubygame 2.2.0-i586-linux

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 (94) hide show
  1. data/CREDITS +60 -0
  2. data/LICENSE +504 -0
  3. data/NEWS +201 -0
  4. data/README +139 -0
  5. data/ROADMAP +43 -0
  6. data/Rakefile +409 -0
  7. data/doc/extended_readme.rdoc +49 -0
  8. data/doc/getting_started.rdoc +47 -0
  9. data/doc/macosx_install.rdoc +70 -0
  10. data/doc/windows_install.rdoc +123 -0
  11. data/ext/rubygame/MANIFEST +25 -0
  12. data/ext/rubygame/rubygame_core.so +0 -0
  13. data/ext/rubygame/rubygame_event.c +644 -0
  14. data/ext/rubygame/rubygame_event.h +48 -0
  15. data/ext/rubygame/rubygame_event.o +0 -0
  16. data/ext/rubygame/rubygame_gfx.c +942 -0
  17. data/ext/rubygame/rubygame_gfx.h +101 -0
  18. data/ext/rubygame/rubygame_gfx.o +0 -0
  19. data/ext/rubygame/rubygame_gfx.so +0 -0
  20. data/ext/rubygame/rubygame_gl.c +154 -0
  21. data/ext/rubygame/rubygame_gl.h +32 -0
  22. data/ext/rubygame/rubygame_gl.o +0 -0
  23. data/ext/rubygame/rubygame_image.c +108 -0
  24. data/ext/rubygame/rubygame_image.h +41 -0
  25. data/ext/rubygame/rubygame_image.o +0 -0
  26. data/ext/rubygame/rubygame_image.so +0 -0
  27. data/ext/rubygame/rubygame_joystick.c +247 -0
  28. data/ext/rubygame/rubygame_joystick.h +41 -0
  29. data/ext/rubygame/rubygame_joystick.o +0 -0
  30. data/ext/rubygame/rubygame_main.c +155 -0
  31. data/ext/rubygame/rubygame_main.h +33 -0
  32. data/ext/rubygame/rubygame_main.o +0 -0
  33. data/ext/rubygame/rubygame_mixer.c +764 -0
  34. data/ext/rubygame/rubygame_mixer.h +62 -0
  35. data/ext/rubygame/rubygame_mixer.o +0 -0
  36. data/ext/rubygame/rubygame_mixer.so +0 -0
  37. data/ext/rubygame/rubygame_screen.c +448 -0
  38. data/ext/rubygame/rubygame_screen.h +43 -0
  39. data/ext/rubygame/rubygame_screen.o +0 -0
  40. data/ext/rubygame/rubygame_shared.c +209 -0
  41. data/ext/rubygame/rubygame_shared.h +60 -0
  42. data/ext/rubygame/rubygame_shared.o +0 -0
  43. data/ext/rubygame/rubygame_surface.c +1147 -0
  44. data/ext/rubygame/rubygame_surface.h +62 -0
  45. data/ext/rubygame/rubygame_surface.o +0 -0
  46. data/ext/rubygame/rubygame_time.c +183 -0
  47. data/ext/rubygame/rubygame_time.h +32 -0
  48. data/ext/rubygame/rubygame_time.o +0 -0
  49. data/ext/rubygame/rubygame_ttf.c +599 -0
  50. data/ext/rubygame/rubygame_ttf.h +69 -0
  51. data/ext/rubygame/rubygame_ttf.o +0 -0
  52. data/ext/rubygame/rubygame_ttf.so +0 -0
  53. data/lib/rubygame/MANIFEST +12 -0
  54. data/lib/rubygame/clock.rb +128 -0
  55. data/lib/rubygame/color/models/base.rb +106 -0
  56. data/lib/rubygame/color/models/hsl.rb +153 -0
  57. data/lib/rubygame/color/models/hsv.rb +149 -0
  58. data/lib/rubygame/color/models/rgb.rb +78 -0
  59. data/lib/rubygame/color/palettes/css.rb +49 -0
  60. data/lib/rubygame/color/palettes/palette.rb +100 -0
  61. data/lib/rubygame/color/palettes/x11.rb +177 -0
  62. data/lib/rubygame/color.rb +79 -0
  63. data/lib/rubygame/constants.rb +238 -0
  64. data/lib/rubygame/event.rb +313 -0
  65. data/lib/rubygame/ftor.rb +370 -0
  66. data/lib/rubygame/hotspot.rb +265 -0
  67. data/lib/rubygame/keyconstants.rb +237 -0
  68. data/lib/rubygame/mediabag.rb +94 -0
  69. data/lib/rubygame/queue.rb +288 -0
  70. data/lib/rubygame/rect.rb +612 -0
  71. data/lib/rubygame/sfont.rb +223 -0
  72. data/lib/rubygame/sprite.rb +511 -0
  73. data/lib/rubygame.rb +41 -0
  74. data/samples/FreeSans.ttf +0 -0
  75. data/samples/GPL.txt +340 -0
  76. data/samples/README +40 -0
  77. data/samples/chimp.bmp +0 -0
  78. data/samples/chimp.rb +313 -0
  79. data/samples/demo_gl.rb +151 -0
  80. data/samples/demo_gl_tex.rb +197 -0
  81. data/samples/demo_music.rb +75 -0
  82. data/samples/demo_rubygame.rb +284 -0
  83. data/samples/demo_sfont.rb +52 -0
  84. data/samples/demo_ttf.rb +193 -0
  85. data/samples/demo_utf8.rb +53 -0
  86. data/samples/fist.bmp +0 -0
  87. data/samples/load_and_blit.rb +22 -0
  88. data/samples/panda.png +0 -0
  89. data/samples/punch.wav +0 -0
  90. data/samples/ruby.png +0 -0
  91. data/samples/song.ogg +0 -0
  92. data/samples/term16.png +0 -0
  93. data/samples/whiff.wav +0 -0
  94. metadata +152 -0
@@ -0,0 +1,41 @@
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
+
22
+ #ifndef _RUBYGAME_JOYSTICK_H
23
+ #define _RUBYGAME_JOYSTICK_H
24
+
25
+ extern void Rubygame_Init_Joystick();
26
+
27
+ extern VALUE cJoy;
28
+
29
+ extern VALUE rbgm_joy_numjoysticks(VALUE);
30
+ extern VALUE rbgm_joy_getname(VALUE, VALUE);
31
+
32
+ extern VALUE rbgm_joystick_new(VALUE, VALUE);
33
+
34
+ extern VALUE rbgm_joystick_index(VALUE);
35
+ extern VALUE rbgm_joystick_name(VALUE);
36
+ extern VALUE rbgm_joystick_numaxes(VALUE);
37
+ extern VALUE rbgm_joystick_numballs(VALUE);
38
+ extern VALUE rbgm_joystick_numhats(VALUE);
39
+ extern VALUE rbgm_joystick_numbuttons(VALUE);
40
+
41
+ #endif
Binary file
@@ -0,0 +1,155 @@
1
+ /*
2
+ *--
3
+ * Rubygame -- Ruby code and bindings to SDL to facilitate game creation
4
+ * Copyright (C) 2004-2007 John Croisant
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ *++
20
+ */
21
+
22
+ #include "rubygame_shared.h"
23
+ #include "rubygame_main.h"
24
+ #include "rubygame_event.h"
25
+ #include "rubygame_gl.h"
26
+ #include "rubygame_joystick.h"
27
+ #include "rubygame_screen.h"
28
+ #include "rubygame_surface.h"
29
+ #include "rubygame_time.h"
30
+
31
+ VALUE rbgm_init(VALUE);
32
+ VALUE rbgm_quit(VALUE);
33
+ void Define_Rubygame_Constants();
34
+
35
+ /*
36
+ * call-seq:
37
+ * key_name(sym) -> string
38
+ *
39
+ * Given the sym of a key, returns a printable representation. This
40
+ * differs from key2str in that this will return a printable string
41
+ * for any key, even non-printable keys such as the arrow keys.
42
+ *
43
+ * This method may raise SDLError if the SDL video subsystem could
44
+ * not be initialized for some reason.
45
+ *
46
+ * Example:
47
+ * Rubygame.key_name( Rubygame::K_A ) # => "a"
48
+ * Rubygame.key_name( Rubygame::K_RETURN ) # => "return"
49
+ * Rubygame.key_name( Rubygame::K_LEFT ) # => "left"
50
+ */
51
+ VALUE rbgm_keyname(VALUE self, VALUE sym)
52
+ {
53
+ /* SDL_GetKeyName only works when video system has been initialized. */
54
+ if( init_video_system() == 0 )
55
+ {
56
+ SDLKey key = NUM2INT(sym);
57
+ char *result = SDL_GetKeyName(key);
58
+ return rb_str_new2(result);
59
+ }
60
+ else
61
+ {
62
+ rb_raise(eSDLError,"Could not initialize SDL video subsystem.");
63
+ return Qnil;
64
+ }
65
+ }
66
+
67
+
68
+ /*
69
+ * call-seq:
70
+ * init -> nil
71
+ *
72
+ * Initialize Rubygame. This should be called soon after you +require+
73
+ * Rubygame, so that everything will work properly.
74
+ */
75
+ VALUE rbgm_init(VALUE module)
76
+ {
77
+ if(SDL_Init(SDL_INIT_EVERYTHING)==0)
78
+ {
79
+ return Qnil;
80
+ }
81
+ else
82
+ {
83
+ rb_raise(eSDLError,"Could not initialize SDL.");
84
+ return Qnil; /* should never get here */
85
+ }
86
+ }
87
+
88
+ /*
89
+ * call-seq:
90
+ * quit -> nil
91
+ *
92
+ * Quit Rubygame. This should be used before your program terminates,
93
+ * especially if you have been using a fullscreen Screen! (Otherwise,
94
+ * the desktop resolution might not revert to its previous setting on
95
+ * some platforms, and your users will be frustrated and confused!)
96
+ */
97
+ VALUE rbgm_quit(VALUE module)
98
+ {
99
+ SDL_Quit();
100
+ return Qnil;
101
+ }
102
+
103
+
104
+ void Init_rubygame_core()
105
+ {
106
+ Init_rubygame_shared();
107
+
108
+ mRubygame = rb_define_module("Rubygame");
109
+
110
+ rb_define_module_function(mRubygame,"init",rbgm_init,0);
111
+ rb_define_module_function(mRubygame,"quit",rbgm_quit,0);
112
+ rb_define_singleton_method(mRubygame,"key_name",rbgm_keyname, 1);
113
+ cRect = rb_define_class_under(mRubygame,"Rect",rb_cArray);
114
+
115
+ rb_hash_aset(rb_ivar_get(mRubygame,rb_intern("VERSIONS")),
116
+ ID2SYM(rb_intern("rubygame")),
117
+ rb_ary_new3(3,
118
+ INT2NUM(RUBYGAME_MAJOR_VERSION),
119
+ INT2NUM(RUBYGAME_MINOR_VERSION),
120
+ INT2NUM(RUBYGAME_PATCHLEVEL)));
121
+ rb_hash_aset(rb_ivar_get(mRubygame,rb_intern("VERSIONS")),
122
+ ID2SYM(rb_intern("sdl")),
123
+ rb_ary_new3(3,
124
+ INT2NUM(SDL_MAJOR_VERSION),
125
+ INT2NUM(SDL_MINOR_VERSION),
126
+ INT2NUM(SDL_PATCHLEVEL)));
127
+
128
+ Rubygame_Init_Time();
129
+ Rubygame_Init_Surface();
130
+ Rubygame_Init_Screen();
131
+ Rubygame_Init_Event();
132
+ Rubygame_Init_Joystick();
133
+ Rubygame_Init_GL();
134
+
135
+ /* Flags for subsystem initialization */
136
+ rb_define_const(mRubygame,"INIT_TIMER",INT2NUM(SDL_INIT_TIMER));
137
+ rb_define_const(mRubygame,"INIT_AUDIO",INT2NUM(SDL_INIT_AUDIO));
138
+ rb_define_const(mRubygame,"INIT_VIDEO",INT2NUM(SDL_INIT_VIDEO));
139
+ rb_define_const(mRubygame,"INIT_CDROM",INT2NUM(SDL_INIT_CDROM));
140
+ rb_define_const(mRubygame,"INIT_JOYSTICK",INT2NUM(SDL_INIT_JOYSTICK));
141
+ rb_define_const(mRubygame,"INIT_NOPARACHUTE",INT2NUM(SDL_INIT_NOPARACHUTE));
142
+ rb_define_const(mRubygame,"INIT_EVENTTHREAD",UINT2NUM(SDL_INIT_EVENTTHREAD));
143
+ rb_define_const(mRubygame,"INIT_EVERYTHING",UINT2NUM(SDL_INIT_EVERYTHING));
144
+
145
+
146
+ /* Define fully opaque and full transparent (0 and 255) */
147
+ rb_define_const(mRubygame,"ALPHA_OPAQUE",UINT2NUM(SDL_ALPHA_OPAQUE));
148
+ rb_define_const(mRubygame,"ALPHA_TRANSPARENT",
149
+ UINT2NUM(SDL_ALPHA_TRANSPARENT));
150
+
151
+
152
+ /* Flags for palettes (?) */
153
+ rb_define_const(mRubygame,"LOGPAL",UINT2NUM(SDL_LOGPAL));
154
+ rb_define_const(mRubygame,"PHYSPAL",UINT2NUM(SDL_PHYSPAL));
155
+ }
@@ -0,0 +1,33 @@
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_H
22
+ #define _RUBYGAME_H
23
+
24
+ #define RUBYGAME_MAJOR_VERSION 2
25
+ #define RUBYGAME_MINOR_VERSION 0
26
+ #define RUBYGAME_PATCHLEVEL 1
27
+
28
+ extern VALUE rbgm_keyname(VALUE, VALUE);
29
+ extern VALUE rbgm_init(VALUE);
30
+ extern VALUE rbgm_quit(VALUE);
31
+ extern void Define_Rubygame_Constants();
32
+
33
+ #endif
Binary file