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.
- data/CREDITS +60 -0
- data/LICENSE +504 -0
- data/NEWS +201 -0
- data/README +139 -0
- data/ROADMAP +43 -0
- data/Rakefile +409 -0
- data/doc/extended_readme.rdoc +49 -0
- data/doc/getting_started.rdoc +47 -0
- data/doc/macosx_install.rdoc +70 -0
- data/doc/windows_install.rdoc +123 -0
- data/ext/rubygame/MANIFEST +25 -0
- data/ext/rubygame/rubygame_core.so +0 -0
- data/ext/rubygame/rubygame_event.c +644 -0
- data/ext/rubygame/rubygame_event.h +48 -0
- data/ext/rubygame/rubygame_event.o +0 -0
- data/ext/rubygame/rubygame_gfx.c +942 -0
- data/ext/rubygame/rubygame_gfx.h +101 -0
- data/ext/rubygame/rubygame_gfx.o +0 -0
- data/ext/rubygame/rubygame_gfx.so +0 -0
- data/ext/rubygame/rubygame_gl.c +154 -0
- data/ext/rubygame/rubygame_gl.h +32 -0
- data/ext/rubygame/rubygame_gl.o +0 -0
- data/ext/rubygame/rubygame_image.c +108 -0
- data/ext/rubygame/rubygame_image.h +41 -0
- data/ext/rubygame/rubygame_image.o +0 -0
- data/ext/rubygame/rubygame_image.so +0 -0
- data/ext/rubygame/rubygame_joystick.c +247 -0
- data/ext/rubygame/rubygame_joystick.h +41 -0
- data/ext/rubygame/rubygame_joystick.o +0 -0
- data/ext/rubygame/rubygame_main.c +155 -0
- data/ext/rubygame/rubygame_main.h +33 -0
- data/ext/rubygame/rubygame_main.o +0 -0
- data/ext/rubygame/rubygame_mixer.c +764 -0
- data/ext/rubygame/rubygame_mixer.h +62 -0
- data/ext/rubygame/rubygame_mixer.o +0 -0
- data/ext/rubygame/rubygame_mixer.so +0 -0
- data/ext/rubygame/rubygame_screen.c +448 -0
- data/ext/rubygame/rubygame_screen.h +43 -0
- data/ext/rubygame/rubygame_screen.o +0 -0
- data/ext/rubygame/rubygame_shared.c +209 -0
- data/ext/rubygame/rubygame_shared.h +60 -0
- data/ext/rubygame/rubygame_shared.o +0 -0
- data/ext/rubygame/rubygame_surface.c +1147 -0
- data/ext/rubygame/rubygame_surface.h +62 -0
- data/ext/rubygame/rubygame_surface.o +0 -0
- data/ext/rubygame/rubygame_time.c +183 -0
- data/ext/rubygame/rubygame_time.h +32 -0
- data/ext/rubygame/rubygame_time.o +0 -0
- data/ext/rubygame/rubygame_ttf.c +599 -0
- data/ext/rubygame/rubygame_ttf.h +69 -0
- data/ext/rubygame/rubygame_ttf.o +0 -0
- data/ext/rubygame/rubygame_ttf.so +0 -0
- data/lib/rubygame/MANIFEST +12 -0
- data/lib/rubygame/clock.rb +128 -0
- data/lib/rubygame/color/models/base.rb +106 -0
- data/lib/rubygame/color/models/hsl.rb +153 -0
- data/lib/rubygame/color/models/hsv.rb +149 -0
- data/lib/rubygame/color/models/rgb.rb +78 -0
- data/lib/rubygame/color/palettes/css.rb +49 -0
- data/lib/rubygame/color/palettes/palette.rb +100 -0
- data/lib/rubygame/color/palettes/x11.rb +177 -0
- data/lib/rubygame/color.rb +79 -0
- data/lib/rubygame/constants.rb +238 -0
- data/lib/rubygame/event.rb +313 -0
- data/lib/rubygame/ftor.rb +370 -0
- data/lib/rubygame/hotspot.rb +265 -0
- data/lib/rubygame/keyconstants.rb +237 -0
- data/lib/rubygame/mediabag.rb +94 -0
- data/lib/rubygame/queue.rb +288 -0
- data/lib/rubygame/rect.rb +612 -0
- data/lib/rubygame/sfont.rb +223 -0
- data/lib/rubygame/sprite.rb +511 -0
- data/lib/rubygame.rb +41 -0
- data/samples/FreeSans.ttf +0 -0
- data/samples/GPL.txt +340 -0
- data/samples/README +40 -0
- data/samples/chimp.bmp +0 -0
- data/samples/chimp.rb +313 -0
- data/samples/demo_gl.rb +151 -0
- data/samples/demo_gl_tex.rb +197 -0
- data/samples/demo_music.rb +75 -0
- data/samples/demo_rubygame.rb +284 -0
- data/samples/demo_sfont.rb +52 -0
- data/samples/demo_ttf.rb +193 -0
- data/samples/demo_utf8.rb +53 -0
- data/samples/fist.bmp +0 -0
- data/samples/load_and_blit.rb +22 -0
- data/samples/panda.png +0 -0
- data/samples/punch.wav +0 -0
- data/samples/ruby.png +0 -0
- data/samples/song.ogg +0 -0
- data/samples/term16.png +0 -0
- data/samples/whiff.wav +0 -0
- metadata +152 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
MANIFEST
|
2
|
+
rubygame_event.c
|
3
|
+
rubygame_event.h
|
4
|
+
rubygame_gfx.c
|
5
|
+
rubygame_gfx.h
|
6
|
+
rubygame_gl.c
|
7
|
+
rubygame_gl.h
|
8
|
+
rubygame_image.c
|
9
|
+
rubygame_image.h
|
10
|
+
rubygame_joystick.c
|
11
|
+
rubygame_joystick.h
|
12
|
+
rubygame_main.c
|
13
|
+
rubygame_main.h
|
14
|
+
rubygame_mixer.c
|
15
|
+
rubygame_mixer.h
|
16
|
+
rubygame_screen.c
|
17
|
+
rubygame_screen.h
|
18
|
+
rubygame_shared.c
|
19
|
+
rubygame_shared.h
|
20
|
+
rubygame_surface.c
|
21
|
+
rubygame_surface.h
|
22
|
+
rubygame_time.c
|
23
|
+
rubygame_time.h
|
24
|
+
rubygame_ttf.c
|
25
|
+
rubygame_ttf.h
|
Binary file
|
@@ -0,0 +1,644 @@
|
|
1
|
+
/*--
|
2
|
+
* Rubygame -- Ruby 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
|
+
#include "rubygame_shared.h"
|
22
|
+
#include "rubygame_event.h"
|
23
|
+
|
24
|
+
void Rubygame_Init_Event();
|
25
|
+
VALUE cEvent;
|
26
|
+
VALUE cActiveEvent;
|
27
|
+
VALUE cKeyDownEvent;
|
28
|
+
VALUE cKeyUpEvent;
|
29
|
+
VALUE cMouseMotionEvent;
|
30
|
+
VALUE cMouseDownEvent;
|
31
|
+
VALUE cMouseUpEvent;
|
32
|
+
VALUE cJoyAxisEvent;
|
33
|
+
VALUE cJoyBallEvent;
|
34
|
+
VALUE cJoyHatEvent;
|
35
|
+
VALUE cJoyDownEvent;
|
36
|
+
VALUE cJoyUpEvent;
|
37
|
+
VALUE cQuitEvent;
|
38
|
+
VALUE cSysWMEvent;
|
39
|
+
VALUE cResizeEvent;
|
40
|
+
VALUE cExposeEvent;
|
41
|
+
VALUE convert_active(Uint8);
|
42
|
+
VALUE convert_keymod(SDLMod);
|
43
|
+
VALUE convert_mousebuttons(Uint8);
|
44
|
+
VALUE rbgm_convert_sdlevent(SDL_Event);
|
45
|
+
VALUE rbgm_queue_getsdl(VALUE);
|
46
|
+
|
47
|
+
/*
|
48
|
+
*--
|
49
|
+
*
|
50
|
+
* SDL Type Ruby type Ruby new() args
|
51
|
+
* ---------------------------------------------------------------------------
|
52
|
+
* SDL_ACTIVEEVENT ActiveEvent gain,state
|
53
|
+
* SDL_KEYDOWN KeyDownEvent key,[mods,...]
|
54
|
+
* SDL_KEYUP KeyUpEvent key,[mods,...]
|
55
|
+
* SDL_MOUSEMOTION MouseMotionEvent [x,y],[xrel,yrel],[buttons,...]
|
56
|
+
* SDL_MOUSEBUTTONDOWN MouseDownEvent [x,y],button
|
57
|
+
* SDL_MOUSEBUTTONUP MouseUpEvent [x,y],button
|
58
|
+
* SDL_JOYAXISMOTION JoyAxisEvent joy,axis,value
|
59
|
+
* SDL_JOYBALLMOTION JoyBallEvent joy,ball,[xrel,yrel]
|
60
|
+
* SDL_JOYHATMOTION JoyHatEvent joy,hat,value
|
61
|
+
* SDL_JOYBUTTONDOWN JoyDownEvent joy,button
|
62
|
+
* SDL_JOYBUTTONUP JoyUpEvent joy,button
|
63
|
+
* SDL_VIDEORESIZE VideoResizeEvent [w,h]
|
64
|
+
* SDL_QUIT QuitEvent (no args)
|
65
|
+
* --------------------------------------------------------------------------
|
66
|
+
*
|
67
|
+
*++
|
68
|
+
*/
|
69
|
+
|
70
|
+
/* Convert info about whether the window has mouse/keyboard focus */
|
71
|
+
VALUE convert_active( Uint8 state )
|
72
|
+
{
|
73
|
+
VALUE array;
|
74
|
+
|
75
|
+
array = rb_ary_new();
|
76
|
+
if(state != 0)
|
77
|
+
{
|
78
|
+
if(state & SDL_APPMOUSEFOCUS)
|
79
|
+
rb_ary_push(array,rb_str_new2("mouse\0"));
|
80
|
+
if(state & SDL_APPINPUTFOCUS)
|
81
|
+
rb_ary_push(array,rb_str_new2("keyboard\0"));
|
82
|
+
if(state & SDL_APPACTIVE)
|
83
|
+
rb_ary_push(array,rb_str_new2("active\0"));
|
84
|
+
}
|
85
|
+
return array;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Convert an OR'd list of KMODs into a Ruby array of keysyms. */
|
89
|
+
VALUE convert_keymod( SDLMod mods )
|
90
|
+
{
|
91
|
+
VALUE array;
|
92
|
+
|
93
|
+
array = rb_ary_new();
|
94
|
+
if(mods != 0)
|
95
|
+
{
|
96
|
+
/* KEY MODIFIER KEY SYM */
|
97
|
+
if(mods & KMOD_LSHIFT) rb_ary_push(array,INT2NUM( SDLK_LSHIFT ));
|
98
|
+
if(mods & KMOD_RSHIFT) rb_ary_push(array,INT2NUM( SDLK_RSHIFT ));
|
99
|
+
if(mods & KMOD_LCTRL) rb_ary_push(array,INT2NUM( SDLK_LCTRL ));
|
100
|
+
if(mods & KMOD_RCTRL) rb_ary_push(array,INT2NUM( SDLK_RCTRL ));
|
101
|
+
if(mods & KMOD_LALT) rb_ary_push(array,INT2NUM( SDLK_LALT ));
|
102
|
+
if(mods & KMOD_RALT) rb_ary_push(array,INT2NUM( SDLK_RALT ));
|
103
|
+
if(mods & KMOD_LMETA) rb_ary_push(array,INT2NUM( SDLK_LMETA ));
|
104
|
+
if(mods & KMOD_RMETA) rb_ary_push(array,INT2NUM( SDLK_RMETA ));
|
105
|
+
if(mods & KMOD_NUM) rb_ary_push(array,INT2NUM( SDLK_NUMLOCK ));
|
106
|
+
if(mods & KMOD_CAPS) rb_ary_push(array,INT2NUM( SDLK_CAPSLOCK ));
|
107
|
+
if(mods & KMOD_MODE) rb_ary_push(array,INT2NUM( SDLK_MODE ));
|
108
|
+
}
|
109
|
+
return array;
|
110
|
+
}
|
111
|
+
|
112
|
+
/* convert a button state into a list of mouse button sym */
|
113
|
+
VALUE convert_mousebuttons( Uint8 state )
|
114
|
+
{
|
115
|
+
VALUE buttons;
|
116
|
+
|
117
|
+
buttons = rb_ary_new();
|
118
|
+
if(state & SDL_BUTTON(1))
|
119
|
+
rb_ary_push(buttons, INT2NUM(SDL_BUTTON_LEFT));
|
120
|
+
if(state & SDL_BUTTON(2))
|
121
|
+
rb_ary_push(buttons, INT2NUM(SDL_BUTTON_MIDDLE));
|
122
|
+
if(state & SDL_BUTTON(3))
|
123
|
+
rb_ary_push(buttons, INT2NUM(SDL_BUTTON_RIGHT));
|
124
|
+
return buttons;
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
#if 0
|
129
|
+
/*
|
130
|
+
* (This method is no longer used, as it depends on unicode enabled in SDL,
|
131
|
+
* and doesn't work for KeyUpEvents)
|
132
|
+
*/
|
133
|
+
/* Convert a unicode char into an ascii string or hex if it is not ascii */
|
134
|
+
VALUE convert_unicode( Uint16 unicode )
|
135
|
+
{
|
136
|
+
char *str;
|
137
|
+
if( unicode < 0x80 && unicode > 0 )
|
138
|
+
asprintf( &str,"%c\0",(char)unicode );
|
139
|
+
else
|
140
|
+
asprintf( &str,"0x%04X\0",unicode );
|
141
|
+
return rb_str_new2(str);
|
142
|
+
}
|
143
|
+
#endif
|
144
|
+
|
145
|
+
|
146
|
+
/*--
|
147
|
+
*
|
148
|
+
* Queue-related functions.
|
149
|
+
*
|
150
|
+
*++
|
151
|
+
*/
|
152
|
+
|
153
|
+
/*--
|
154
|
+
*
|
155
|
+
* call-seq:
|
156
|
+
* rbgm_convert_sdlevent( SDL_Event ) -> Rubygame_Event
|
157
|
+
*
|
158
|
+
* Converts an SDL_Event (C type) into a Rubygame Event of the corresponding
|
159
|
+
* class.
|
160
|
+
*
|
161
|
+
*++
|
162
|
+
*/
|
163
|
+
|
164
|
+
VALUE rbgm_convert_sdlevent( SDL_Event ev )
|
165
|
+
{
|
166
|
+
VALUE new = rb_intern("new"); /* to call new() for any class */
|
167
|
+
|
168
|
+
/*
|
169
|
+
switch for each particular type, call new() for the corresponding
|
170
|
+
Rubygame class, with the proper arguments.
|
171
|
+
*/
|
172
|
+
switch(ev.type)
|
173
|
+
{
|
174
|
+
case SDL_ACTIVEEVENT:
|
175
|
+
/* ActiveEvent.new(gain,state) */
|
176
|
+
return rb_funcall(cActiveEvent,new,2,\
|
177
|
+
ev.active.gain, convert_active(ev.active.state));
|
178
|
+
break;
|
179
|
+
case SDL_KEYDOWN:
|
180
|
+
/* KeyDownEvent.new(keysym,[mods,...]) */
|
181
|
+
return rb_funcall(cKeyDownEvent,new,2,\
|
182
|
+
/* keysym, string version is set in new()*/
|
183
|
+
INT2NUM(ev.key.keysym.sym),\
|
184
|
+
/* convert OR'd list of mods into Array of keysyms */
|
185
|
+
convert_keymod(ev.key.keysym.mod)\
|
186
|
+
);
|
187
|
+
break;
|
188
|
+
case SDL_KEYUP: /* Same as SDL_KEYDOWN */
|
189
|
+
/* KeyUpEvent.new(keysym,[mods,...]) */
|
190
|
+
return rb_funcall(cKeyUpEvent,new,2,\
|
191
|
+
INT2NUM(ev.key.keysym.sym),\
|
192
|
+
convert_keymod(ev.key.keysym.mod));
|
193
|
+
break;
|
194
|
+
case SDL_MOUSEMOTION:;
|
195
|
+
|
196
|
+
/* MouseMotionEvent.new([x,y],[xrel,yrel],[buttons,...]) */
|
197
|
+
return rb_funcall(cMouseMotionEvent,new,3,\
|
198
|
+
rb_ary_new3(2,INT2NUM(ev.motion.x),INT2NUM(ev.motion.y)),\
|
199
|
+
rb_ary_new3(2,INT2NUM(ev.motion.xrel),\
|
200
|
+
INT2NUM(ev.motion.yrel)),\
|
201
|
+
/* Prepare list of buttons from OR'd list */
|
202
|
+
convert_mousebuttons(ev.motion.state));
|
203
|
+
break;
|
204
|
+
case SDL_MOUSEBUTTONDOWN:
|
205
|
+
/* MouseDownEvent.new([x,y],button) */
|
206
|
+
return rb_funcall(cMouseDownEvent,new,2,\
|
207
|
+
rb_ary_new3(2,INT2NUM(ev.button.x),INT2NUM(ev.button.y)),\
|
208
|
+
INT2NUM(ev.button.button));
|
209
|
+
break;
|
210
|
+
case SDL_MOUSEBUTTONUP:
|
211
|
+
/* MouseUpEvent.new([x,y],button) */
|
212
|
+
return rb_funcall(cMouseUpEvent,new,2,\
|
213
|
+
rb_ary_new3(2,INT2NUM(ev.button.x),INT2NUM(ev.button.y)),\
|
214
|
+
INT2NUM(ev.button.button));
|
215
|
+
break;
|
216
|
+
case SDL_JOYAXISMOTION:
|
217
|
+
/* JoyAxisEvent.new(joy,axis,value) */
|
218
|
+
/* Eventually, joy might be a reference to a Joystick instance? */
|
219
|
+
return rb_funcall(cJoyAxisEvent,new,3,\
|
220
|
+
INT2NUM(ev.jaxis.which),INT2NUM(ev.jaxis.axis),\
|
221
|
+
INT2NUM(ev.jaxis.value));
|
222
|
+
break;
|
223
|
+
case SDL_JOYBALLMOTION:
|
224
|
+
/* JoyBallEvent.new(joy,ball,) */
|
225
|
+
/* Eventually, joy might be a reference to a Joystick instance? */
|
226
|
+
return rb_funcall(cJoyBallEvent,new,3,\
|
227
|
+
INT2NUM(ev.jball.which),INT2NUM(ev.jball.ball),
|
228
|
+
rb_ary_new3(2,INT2NUM(ev.jball.xrel),INT2NUM(ev.jball.yrel)));
|
229
|
+
break;
|
230
|
+
case SDL_JOYHATMOTION:
|
231
|
+
/* JoyHatEvent.new(joy,hat,value) */
|
232
|
+
/* Eventually, joy might be a reference to a Joystick instance? */
|
233
|
+
return rb_funcall(cJoyHatEvent,new,3,\
|
234
|
+
INT2NUM(ev.jhat.which),INT2NUM(ev.jhat.hat),\
|
235
|
+
INT2NUM(ev.jhat.value));
|
236
|
+
break;
|
237
|
+
case SDL_JOYBUTTONDOWN:
|
238
|
+
/* JoyDownEvent.new(joy,button) */
|
239
|
+
/* Eventually, joy might be a reference to a Joystick instance? */
|
240
|
+
return rb_funcall(cJoyDownEvent,new,2,\
|
241
|
+
INT2NUM(ev.jbutton.which),INT2NUM(ev.jbutton.button));
|
242
|
+
break;
|
243
|
+
case SDL_JOYBUTTONUP:
|
244
|
+
/* JoyUp.new(joy,button) */
|
245
|
+
/* Eventually, joy might be a reference to a Joystick instance? */
|
246
|
+
return rb_funcall(cJoyUpEvent,new,2,\
|
247
|
+
INT2NUM(ev.jbutton.which),INT2NUM(ev.jbutton.button));
|
248
|
+
break;
|
249
|
+
case SDL_VIDEORESIZE:
|
250
|
+
/* ResizeEvent.new([w,h]) */
|
251
|
+
return rb_funcall(cResizeEvent,new,1,\
|
252
|
+
rb_ary_new3(2,INT2NUM(ev.resize.w),INT2NUM(ev.resize.h)));
|
253
|
+
break;
|
254
|
+
case SDL_VIDEOEXPOSE:
|
255
|
+
/* ExposeEvent.new( ) */
|
256
|
+
return rb_funcall(cExposeEvent,new,0);
|
257
|
+
break;
|
258
|
+
case SDL_QUIT:
|
259
|
+
/* QuitEvent.new( ) */
|
260
|
+
return rb_funcall(cQuitEvent,new,0);
|
261
|
+
break;
|
262
|
+
default:
|
263
|
+
rb_warn("Cannot convert unknown event type (%d).", ev.type);
|
264
|
+
return Qnil;
|
265
|
+
break;
|
266
|
+
}
|
267
|
+
return Qnil; /* should never get here */
|
268
|
+
}
|
269
|
+
|
270
|
+
/*
|
271
|
+
* call-seq:
|
272
|
+
* fetch_sdl_events -> [Event, ...]
|
273
|
+
*
|
274
|
+
* Retrieves all pending events from SDL's event stack and converts them
|
275
|
+
* into Rubygame Event objects. Returns an Array of all the events, in
|
276
|
+
* the order they were read.
|
277
|
+
*
|
278
|
+
* This method is used by the EventQueue class, so don't call it if you are
|
279
|
+
* using EventQueue for event management! If you do, the EventQueue will not
|
280
|
+
* receive all the events, because they will have been removed from SDL's
|
281
|
+
* event stack by this method.
|
282
|
+
*
|
283
|
+
* However, if you aren't using EventQueue, you can safely use this method
|
284
|
+
* to make your own event management system.
|
285
|
+
*/
|
286
|
+
VALUE rbgm_fetchevents(VALUE self)
|
287
|
+
{
|
288
|
+
SDL_Event event;
|
289
|
+
VALUE event_array;
|
290
|
+
|
291
|
+
event_array = rb_ary_new();
|
292
|
+
/* put each in *event until no pending events are in SDL's queue */
|
293
|
+
/* for now, we don't care what type the event in. Filtering comes later */
|
294
|
+
while(SDL_PollEvent(&event)==1)
|
295
|
+
{
|
296
|
+
rb_ary_push(event_array, rbgm_convert_sdlevent(event) );
|
297
|
+
}
|
298
|
+
return event_array;
|
299
|
+
}
|
300
|
+
|
301
|
+
/*
|
302
|
+
*--
|
303
|
+
* The event documentation is in rubygame/lib/rubygame/event.rb
|
304
|
+
*++
|
305
|
+
*/
|
306
|
+
void Rubygame_Init_Event()
|
307
|
+
{
|
308
|
+
#if 0
|
309
|
+
mRubygame = rb_define_module("Rubygame");
|
310
|
+
#endif
|
311
|
+
|
312
|
+
rb_define_singleton_method(mRubygame, "fetch_sdl_events",rbgm_fetchevents,0);
|
313
|
+
|
314
|
+
cEvent = rb_define_class_under(mRubygame,"Event",rb_cObject);
|
315
|
+
cActiveEvent = rb_define_class_under(mRubygame,"ActiveEvent",cEvent);
|
316
|
+
cKeyDownEvent = rb_define_class_under(mRubygame,"KeyDownEvent",cEvent);
|
317
|
+
cKeyUpEvent = rb_define_class_under(mRubygame,"KeyUpEvent",cEvent);
|
318
|
+
cMouseMotionEvent = rb_define_class_under(mRubygame,"MouseMotionEvent",\
|
319
|
+
cEvent);
|
320
|
+
cMouseDownEvent = rb_define_class_under(mRubygame,"MouseDownEvent",cEvent);
|
321
|
+
cMouseUpEvent = rb_define_class_under(mRubygame,"MouseUpEvent",cEvent);
|
322
|
+
cJoyAxisEvent = rb_define_class_under(mRubygame,"JoyAxisEvent",cEvent);
|
323
|
+
cJoyBallEvent = rb_define_class_under(mRubygame,"JoyBallEvent",cEvent);
|
324
|
+
cJoyHatEvent = rb_define_class_under(mRubygame,"JoyHatEvent",cEvent);
|
325
|
+
cJoyDownEvent = rb_define_class_under(mRubygame,"JoyDownEvent",cEvent);
|
326
|
+
cJoyUpEvent = rb_define_class_under(mRubygame,"JoyUpEvent",cEvent);
|
327
|
+
cQuitEvent = rb_define_class_under(mRubygame,"QuitEvent",cEvent);
|
328
|
+
cResizeEvent = rb_define_class_under(mRubygame,"ResizeEvent",cEvent);
|
329
|
+
cExposeEvent = rb_define_class_under(mRubygame,"ExposeEvent",cEvent);
|
330
|
+
|
331
|
+
/* Event constants */
|
332
|
+
rb_define_const(mRubygame,"NOEVENT",UINT2NUM(SDL_NOEVENT));
|
333
|
+
rb_define_const(mRubygame,"ACTIVEEVENT",UINT2NUM(SDL_ACTIVEEVENT));
|
334
|
+
rb_define_const(mRubygame,"KEYDOWN",UINT2NUM(SDL_KEYDOWN));
|
335
|
+
rb_define_const(mRubygame,"KEYUP",UINT2NUM(SDL_KEYUP));
|
336
|
+
rb_define_const(mRubygame,"MOUSEMOTION",UINT2NUM(SDL_MOUSEMOTION));
|
337
|
+
rb_define_const(mRubygame,"MOUSEBUTTONDOWN",UINT2NUM(SDL_MOUSEBUTTONDOWN));
|
338
|
+
rb_define_const(mRubygame,"MOUSEBUTTONUP",UINT2NUM(SDL_MOUSEBUTTONUP));
|
339
|
+
rb_define_const(mRubygame,"JOYAXISMOTION",UINT2NUM(SDL_JOYAXISMOTION));
|
340
|
+
rb_define_const(mRubygame,"JOYBALLMOTION",UINT2NUM(SDL_JOYBALLMOTION));
|
341
|
+
rb_define_const(mRubygame,"JOYHATMOTION",UINT2NUM(SDL_JOYHATMOTION));
|
342
|
+
rb_define_const(mRubygame,"JOYBUTTONDOWN",UINT2NUM(SDL_JOYBUTTONDOWN));
|
343
|
+
rb_define_const(mRubygame,"JOYBUTTONUP",UINT2NUM(SDL_JOYBUTTONUP));
|
344
|
+
rb_define_const(mRubygame,"QUIT",UINT2NUM(SDL_QUIT));
|
345
|
+
rb_define_const(mRubygame,"SYSWMEVENT",UINT2NUM(SDL_SYSWMEVENT));
|
346
|
+
rb_define_const(mRubygame,"VIDEORESIZE",UINT2NUM(SDL_VIDEORESIZE));
|
347
|
+
rb_define_const(mRubygame,"VIDEOEXPOSE",UINT2NUM(SDL_VIDEOEXPOSE));
|
348
|
+
rb_define_const(mRubygame,"USEREVENT",UINT2NUM(SDL_USEREVENT));
|
349
|
+
|
350
|
+
/* Joystick constants */
|
351
|
+
rb_define_const(mRubygame,"HAT_CENTERED",UINT2NUM(SDL_HAT_CENTERED));
|
352
|
+
rb_define_const(mRubygame,"HAT_UP",UINT2NUM(SDL_HAT_UP));
|
353
|
+
rb_define_const(mRubygame,"HAT_RIGHT",UINT2NUM(SDL_HAT_RIGHT));
|
354
|
+
rb_define_const(mRubygame,"HAT_DOWN",UINT2NUM(SDL_HAT_DOWN));
|
355
|
+
rb_define_const(mRubygame,"HAT_LEFT",UINT2NUM(SDL_HAT_LEFT));
|
356
|
+
rb_define_const(mRubygame,"HAT_RIGHTUP",UINT2NUM(SDL_HAT_RIGHTUP));
|
357
|
+
rb_define_const(mRubygame,"HAT_RIGHTDOWN",UINT2NUM(SDL_HAT_RIGHTDOWN));
|
358
|
+
rb_define_const(mRubygame,"HAT_LEFTUP",UINT2NUM(SDL_HAT_LEFTUP));
|
359
|
+
rb_define_const(mRubygame,"HAT_LEFTDOWN",UINT2NUM(SDL_HAT_LEFTDOWN));
|
360
|
+
|
361
|
+
|
362
|
+
/* Mouse constants */
|
363
|
+
rb_define_const(mRubygame,"MOUSE_LEFT",UINT2NUM(SDL_BUTTON_LEFT));
|
364
|
+
rb_define_const(mRubygame,"MOUSE_MIDDLE",UINT2NUM(SDL_BUTTON_MIDDLE));
|
365
|
+
rb_define_const(mRubygame,"MOUSE_RIGHT",UINT2NUM(SDL_BUTTON_RIGHT));
|
366
|
+
rb_define_const(mRubygame,"MOUSE_LMASK",UINT2NUM(SDL_BUTTON_LMASK));
|
367
|
+
rb_define_const(mRubygame,"MOUSE_MMASK",UINT2NUM(SDL_BUTTON_MMASK));
|
368
|
+
rb_define_const(mRubygame,"MOUSE_RMASK",UINT2NUM(SDL_BUTTON_RMASK));
|
369
|
+
|
370
|
+
/* ASCII key symbols */
|
371
|
+
rb_define_const(mRubygame,"K_UNKNOWN",UINT2NUM(SDLK_UNKNOWN));
|
372
|
+
rb_define_const(mRubygame,"K_FIRST",UINT2NUM(SDLK_FIRST));
|
373
|
+
rb_define_const(mRubygame,"K_BACKSPACE",UINT2NUM(SDLK_BACKSPACE));
|
374
|
+
rb_define_const(mRubygame,"K_TAB",UINT2NUM(SDLK_TAB));
|
375
|
+
rb_define_const(mRubygame,"K_CLEAR",UINT2NUM(SDLK_CLEAR));
|
376
|
+
rb_define_const(mRubygame,"K_RETURN",UINT2NUM(SDLK_RETURN));
|
377
|
+
rb_define_const(mRubygame,"K_PAUSE",UINT2NUM(SDLK_PAUSE));
|
378
|
+
rb_define_const(mRubygame,"K_ESCAPE",UINT2NUM(SDLK_ESCAPE));
|
379
|
+
rb_define_const(mRubygame,"K_SPACE",UINT2NUM(SDLK_SPACE));
|
380
|
+
rb_define_const(mRubygame,"K_EXCLAIM",UINT2NUM(SDLK_EXCLAIM));
|
381
|
+
rb_define_const(mRubygame,"K_QUOTEDBL",UINT2NUM(SDLK_QUOTEDBL));
|
382
|
+
rb_define_const(mRubygame,"K_HASH",UINT2NUM(SDLK_HASH));
|
383
|
+
rb_define_const(mRubygame,"K_DOLLAR",UINT2NUM(SDLK_DOLLAR));
|
384
|
+
rb_define_const(mRubygame,"K_AMPERSAND",UINT2NUM(SDLK_AMPERSAND));
|
385
|
+
rb_define_const(mRubygame,"K_QUOTE",UINT2NUM(SDLK_QUOTE));
|
386
|
+
rb_define_const(mRubygame,"K_LEFTPAREN",UINT2NUM(SDLK_LEFTPAREN));
|
387
|
+
rb_define_const(mRubygame,"K_RIGHTPAREN",UINT2NUM(SDLK_RIGHTPAREN));
|
388
|
+
rb_define_const(mRubygame,"K_ASTERISK",UINT2NUM(SDLK_ASTERISK));
|
389
|
+
rb_define_const(mRubygame,"K_PLUS",UINT2NUM(SDLK_PLUS));
|
390
|
+
rb_define_const(mRubygame,"K_COMMA",UINT2NUM(SDLK_COMMA));
|
391
|
+
rb_define_const(mRubygame,"K_MINUS",UINT2NUM(SDLK_MINUS));
|
392
|
+
rb_define_const(mRubygame,"K_PERIOD",UINT2NUM(SDLK_PERIOD));
|
393
|
+
rb_define_const(mRubygame,"K_SLASH",UINT2NUM(SDLK_SLASH));
|
394
|
+
rb_define_const(mRubygame,"K_0",UINT2NUM(SDLK_0));
|
395
|
+
rb_define_const(mRubygame,"K_1",UINT2NUM(SDLK_1));
|
396
|
+
rb_define_const(mRubygame,"K_2",UINT2NUM(SDLK_2));
|
397
|
+
rb_define_const(mRubygame,"K_3",UINT2NUM(SDLK_3));
|
398
|
+
rb_define_const(mRubygame,"K_4",UINT2NUM(SDLK_4));
|
399
|
+
rb_define_const(mRubygame,"K_5",UINT2NUM(SDLK_5));
|
400
|
+
rb_define_const(mRubygame,"K_6",UINT2NUM(SDLK_6));
|
401
|
+
rb_define_const(mRubygame,"K_7",UINT2NUM(SDLK_7));
|
402
|
+
rb_define_const(mRubygame,"K_8",UINT2NUM(SDLK_8));
|
403
|
+
rb_define_const(mRubygame,"K_9",UINT2NUM(SDLK_9));
|
404
|
+
rb_define_const(mRubygame,"K_COLON",UINT2NUM(SDLK_COLON));
|
405
|
+
rb_define_const(mRubygame,"K_SEMICOLON",UINT2NUM(SDLK_SEMICOLON));
|
406
|
+
rb_define_const(mRubygame,"K_LESS",UINT2NUM(SDLK_LESS));
|
407
|
+
rb_define_const(mRubygame,"K_EQUALS",UINT2NUM(SDLK_EQUALS));
|
408
|
+
rb_define_const(mRubygame,"K_GREATER",UINT2NUM(SDLK_GREATER));
|
409
|
+
rb_define_const(mRubygame,"K_QUESTION",UINT2NUM(SDLK_QUESTION));
|
410
|
+
rb_define_const(mRubygame,"K_AT",UINT2NUM(SDLK_AT));
|
411
|
+
rb_define_const(mRubygame,"K_LEFTBRACKET",UINT2NUM(SDLK_LEFTBRACKET));
|
412
|
+
rb_define_const(mRubygame,"K_BACKSLASH",UINT2NUM(SDLK_BACKSLASH));
|
413
|
+
rb_define_const(mRubygame,"K_RIGHTBRACKET",UINT2NUM(SDLK_RIGHTBRACKET));
|
414
|
+
rb_define_const(mRubygame,"K_CARET",UINT2NUM(SDLK_CARET));
|
415
|
+
rb_define_const(mRubygame,"K_UNDERSCORE",UINT2NUM(SDLK_UNDERSCORE));
|
416
|
+
rb_define_const(mRubygame,"K_BACKQUOTE",UINT2NUM(SDLK_BACKQUOTE));
|
417
|
+
rb_define_const(mRubygame,"K_A",UINT2NUM(SDLK_a));
|
418
|
+
rb_define_const(mRubygame,"K_B",UINT2NUM(SDLK_b));
|
419
|
+
rb_define_const(mRubygame,"K_C",UINT2NUM(SDLK_c));
|
420
|
+
rb_define_const(mRubygame,"K_D",UINT2NUM(SDLK_d));
|
421
|
+
rb_define_const(mRubygame,"K_E",UINT2NUM(SDLK_e));
|
422
|
+
rb_define_const(mRubygame,"K_F",UINT2NUM(SDLK_f));
|
423
|
+
rb_define_const(mRubygame,"K_G",UINT2NUM(SDLK_g));
|
424
|
+
rb_define_const(mRubygame,"K_H",UINT2NUM(SDLK_h));
|
425
|
+
rb_define_const(mRubygame,"K_I",UINT2NUM(SDLK_i));
|
426
|
+
rb_define_const(mRubygame,"K_J",UINT2NUM(SDLK_j));
|
427
|
+
rb_define_const(mRubygame,"K_K",UINT2NUM(SDLK_k));
|
428
|
+
rb_define_const(mRubygame,"K_L",UINT2NUM(SDLK_l));
|
429
|
+
rb_define_const(mRubygame,"K_M",UINT2NUM(SDLK_m));
|
430
|
+
rb_define_const(mRubygame,"K_N",UINT2NUM(SDLK_n));
|
431
|
+
rb_define_const(mRubygame,"K_O",UINT2NUM(SDLK_o));
|
432
|
+
rb_define_const(mRubygame,"K_P",UINT2NUM(SDLK_p));
|
433
|
+
rb_define_const(mRubygame,"K_Q",UINT2NUM(SDLK_q));
|
434
|
+
rb_define_const(mRubygame,"K_R",UINT2NUM(SDLK_r));
|
435
|
+
rb_define_const(mRubygame,"K_S",UINT2NUM(SDLK_s));
|
436
|
+
rb_define_const(mRubygame,"K_T",UINT2NUM(SDLK_t));
|
437
|
+
rb_define_const(mRubygame,"K_U",UINT2NUM(SDLK_u));
|
438
|
+
rb_define_const(mRubygame,"K_V",UINT2NUM(SDLK_v));
|
439
|
+
rb_define_const(mRubygame,"K_W",UINT2NUM(SDLK_w));
|
440
|
+
rb_define_const(mRubygame,"K_X",UINT2NUM(SDLK_x));
|
441
|
+
rb_define_const(mRubygame,"K_Y",UINT2NUM(SDLK_y));
|
442
|
+
rb_define_const(mRubygame,"K_Z",UINT2NUM(SDLK_z));
|
443
|
+
rb_define_const(mRubygame,"K_DELETE",UINT2NUM(SDLK_DELETE));
|
444
|
+
|
445
|
+
|
446
|
+
/* International keyboard symbols */
|
447
|
+
rb_define_const(mRubygame,"K_WORLD_0",UINT2NUM(SDLK_WORLD_0));
|
448
|
+
rb_define_const(mRubygame,"K_WORLD_1",UINT2NUM(SDLK_WORLD_1));
|
449
|
+
rb_define_const(mRubygame,"K_WORLD_2",UINT2NUM(SDLK_WORLD_2));
|
450
|
+
rb_define_const(mRubygame,"K_WORLD_3",UINT2NUM(SDLK_WORLD_3));
|
451
|
+
rb_define_const(mRubygame,"K_WORLD_4",UINT2NUM(SDLK_WORLD_4));
|
452
|
+
rb_define_const(mRubygame,"K_WORLD_5",UINT2NUM(SDLK_WORLD_5));
|
453
|
+
rb_define_const(mRubygame,"K_WORLD_6",UINT2NUM(SDLK_WORLD_6));
|
454
|
+
rb_define_const(mRubygame,"K_WORLD_7",UINT2NUM(SDLK_WORLD_7));
|
455
|
+
rb_define_const(mRubygame,"K_WORLD_8",UINT2NUM(SDLK_WORLD_8));
|
456
|
+
rb_define_const(mRubygame,"K_WORLD_9",UINT2NUM(SDLK_WORLD_9));
|
457
|
+
rb_define_const(mRubygame,"K_WORLD_10",UINT2NUM(SDLK_WORLD_10));
|
458
|
+
rb_define_const(mRubygame,"K_WORLD_11",UINT2NUM(SDLK_WORLD_11));
|
459
|
+
rb_define_const(mRubygame,"K_WORLD_12",UINT2NUM(SDLK_WORLD_12));
|
460
|
+
rb_define_const(mRubygame,"K_WORLD_13",UINT2NUM(SDLK_WORLD_13));
|
461
|
+
rb_define_const(mRubygame,"K_WORLD_14",UINT2NUM(SDLK_WORLD_14));
|
462
|
+
rb_define_const(mRubygame,"K_WORLD_15",UINT2NUM(SDLK_WORLD_15));
|
463
|
+
rb_define_const(mRubygame,"K_WORLD_16",UINT2NUM(SDLK_WORLD_16));
|
464
|
+
rb_define_const(mRubygame,"K_WORLD_17",UINT2NUM(SDLK_WORLD_17));
|
465
|
+
rb_define_const(mRubygame,"K_WORLD_18",UINT2NUM(SDLK_WORLD_18));
|
466
|
+
rb_define_const(mRubygame,"K_WORLD_19",UINT2NUM(SDLK_WORLD_19));
|
467
|
+
rb_define_const(mRubygame,"K_WORLD_20",UINT2NUM(SDLK_WORLD_20));
|
468
|
+
rb_define_const(mRubygame,"K_WORLD_21",UINT2NUM(SDLK_WORLD_21));
|
469
|
+
rb_define_const(mRubygame,"K_WORLD_22",UINT2NUM(SDLK_WORLD_22));
|
470
|
+
rb_define_const(mRubygame,"K_WORLD_23",UINT2NUM(SDLK_WORLD_23));
|
471
|
+
rb_define_const(mRubygame,"K_WORLD_24",UINT2NUM(SDLK_WORLD_24));
|
472
|
+
rb_define_const(mRubygame,"K_WORLD_25",UINT2NUM(SDLK_WORLD_25));
|
473
|
+
rb_define_const(mRubygame,"K_WORLD_26",UINT2NUM(SDLK_WORLD_26));
|
474
|
+
rb_define_const(mRubygame,"K_WORLD_27",UINT2NUM(SDLK_WORLD_27));
|
475
|
+
rb_define_const(mRubygame,"K_WORLD_28",UINT2NUM(SDLK_WORLD_28));
|
476
|
+
rb_define_const(mRubygame,"K_WORLD_29",UINT2NUM(SDLK_WORLD_29));
|
477
|
+
rb_define_const(mRubygame,"K_WORLD_30",UINT2NUM(SDLK_WORLD_30));
|
478
|
+
rb_define_const(mRubygame,"K_WORLD_31",UINT2NUM(SDLK_WORLD_31));
|
479
|
+
rb_define_const(mRubygame,"K_WORLD_32",UINT2NUM(SDLK_WORLD_32));
|
480
|
+
rb_define_const(mRubygame,"K_WORLD_33",UINT2NUM(SDLK_WORLD_33));
|
481
|
+
rb_define_const(mRubygame,"K_WORLD_34",UINT2NUM(SDLK_WORLD_34));
|
482
|
+
rb_define_const(mRubygame,"K_WORLD_35",UINT2NUM(SDLK_WORLD_35));
|
483
|
+
rb_define_const(mRubygame,"K_WORLD_36",UINT2NUM(SDLK_WORLD_36));
|
484
|
+
rb_define_const(mRubygame,"K_WORLD_37",UINT2NUM(SDLK_WORLD_37));
|
485
|
+
rb_define_const(mRubygame,"K_WORLD_38",UINT2NUM(SDLK_WORLD_38));
|
486
|
+
rb_define_const(mRubygame,"K_WORLD_39",UINT2NUM(SDLK_WORLD_39));
|
487
|
+
rb_define_const(mRubygame,"K_WORLD_40",UINT2NUM(SDLK_WORLD_40));
|
488
|
+
rb_define_const(mRubygame,"K_WORLD_41",UINT2NUM(SDLK_WORLD_41));
|
489
|
+
rb_define_const(mRubygame,"K_WORLD_42",UINT2NUM(SDLK_WORLD_42));
|
490
|
+
rb_define_const(mRubygame,"K_WORLD_43",UINT2NUM(SDLK_WORLD_43));
|
491
|
+
rb_define_const(mRubygame,"K_WORLD_44",UINT2NUM(SDLK_WORLD_44));
|
492
|
+
rb_define_const(mRubygame,"K_WORLD_45",UINT2NUM(SDLK_WORLD_45));
|
493
|
+
rb_define_const(mRubygame,"K_WORLD_46",UINT2NUM(SDLK_WORLD_46));
|
494
|
+
rb_define_const(mRubygame,"K_WORLD_47",UINT2NUM(SDLK_WORLD_47));
|
495
|
+
rb_define_const(mRubygame,"K_WORLD_48",UINT2NUM(SDLK_WORLD_48));
|
496
|
+
rb_define_const(mRubygame,"K_WORLD_49",UINT2NUM(SDLK_WORLD_49));
|
497
|
+
rb_define_const(mRubygame,"K_WORLD_50",UINT2NUM(SDLK_WORLD_50));
|
498
|
+
rb_define_const(mRubygame,"K_WORLD_51",UINT2NUM(SDLK_WORLD_51));
|
499
|
+
rb_define_const(mRubygame,"K_WORLD_52",UINT2NUM(SDLK_WORLD_52));
|
500
|
+
rb_define_const(mRubygame,"K_WORLD_53",UINT2NUM(SDLK_WORLD_53));
|
501
|
+
rb_define_const(mRubygame,"K_WORLD_54",UINT2NUM(SDLK_WORLD_54));
|
502
|
+
rb_define_const(mRubygame,"K_WORLD_55",UINT2NUM(SDLK_WORLD_55));
|
503
|
+
rb_define_const(mRubygame,"K_WORLD_56",UINT2NUM(SDLK_WORLD_56));
|
504
|
+
rb_define_const(mRubygame,"K_WORLD_57",UINT2NUM(SDLK_WORLD_57));
|
505
|
+
rb_define_const(mRubygame,"K_WORLD_58",UINT2NUM(SDLK_WORLD_58));
|
506
|
+
rb_define_const(mRubygame,"K_WORLD_59",UINT2NUM(SDLK_WORLD_59));
|
507
|
+
rb_define_const(mRubygame,"K_WORLD_60",UINT2NUM(SDLK_WORLD_60));
|
508
|
+
rb_define_const(mRubygame,"K_WORLD_61",UINT2NUM(SDLK_WORLD_61));
|
509
|
+
rb_define_const(mRubygame,"K_WORLD_62",UINT2NUM(SDLK_WORLD_62));
|
510
|
+
rb_define_const(mRubygame,"K_WORLD_63",UINT2NUM(SDLK_WORLD_63));
|
511
|
+
rb_define_const(mRubygame,"K_WORLD_64",UINT2NUM(SDLK_WORLD_64));
|
512
|
+
rb_define_const(mRubygame,"K_WORLD_65",UINT2NUM(SDLK_WORLD_65));
|
513
|
+
rb_define_const(mRubygame,"K_WORLD_66",UINT2NUM(SDLK_WORLD_66));
|
514
|
+
rb_define_const(mRubygame,"K_WORLD_67",UINT2NUM(SDLK_WORLD_67));
|
515
|
+
rb_define_const(mRubygame,"K_WORLD_68",UINT2NUM(SDLK_WORLD_68));
|
516
|
+
rb_define_const(mRubygame,"K_WORLD_69",UINT2NUM(SDLK_WORLD_69));
|
517
|
+
rb_define_const(mRubygame,"K_WORLD_70",UINT2NUM(SDLK_WORLD_70));
|
518
|
+
rb_define_const(mRubygame,"K_WORLD_71",UINT2NUM(SDLK_WORLD_71));
|
519
|
+
rb_define_const(mRubygame,"K_WORLD_72",UINT2NUM(SDLK_WORLD_72));
|
520
|
+
rb_define_const(mRubygame,"K_WORLD_73",UINT2NUM(SDLK_WORLD_73));
|
521
|
+
rb_define_const(mRubygame,"K_WORLD_74",UINT2NUM(SDLK_WORLD_74));
|
522
|
+
rb_define_const(mRubygame,"K_WORLD_75",UINT2NUM(SDLK_WORLD_75));
|
523
|
+
rb_define_const(mRubygame,"K_WORLD_76",UINT2NUM(SDLK_WORLD_76));
|
524
|
+
rb_define_const(mRubygame,"K_WORLD_77",UINT2NUM(SDLK_WORLD_77));
|
525
|
+
rb_define_const(mRubygame,"K_WORLD_78",UINT2NUM(SDLK_WORLD_78));
|
526
|
+
rb_define_const(mRubygame,"K_WORLD_79",UINT2NUM(SDLK_WORLD_79));
|
527
|
+
rb_define_const(mRubygame,"K_WORLD_80",UINT2NUM(SDLK_WORLD_80));
|
528
|
+
rb_define_const(mRubygame,"K_WORLD_81",UINT2NUM(SDLK_WORLD_81));
|
529
|
+
rb_define_const(mRubygame,"K_WORLD_82",UINT2NUM(SDLK_WORLD_82));
|
530
|
+
rb_define_const(mRubygame,"K_WORLD_83",UINT2NUM(SDLK_WORLD_83));
|
531
|
+
rb_define_const(mRubygame,"K_WORLD_84",UINT2NUM(SDLK_WORLD_84));
|
532
|
+
rb_define_const(mRubygame,"K_WORLD_85",UINT2NUM(SDLK_WORLD_85));
|
533
|
+
rb_define_const(mRubygame,"K_WORLD_86",UINT2NUM(SDLK_WORLD_86));
|
534
|
+
rb_define_const(mRubygame,"K_WORLD_87",UINT2NUM(SDLK_WORLD_87));
|
535
|
+
rb_define_const(mRubygame,"K_WORLD_88",UINT2NUM(SDLK_WORLD_88));
|
536
|
+
rb_define_const(mRubygame,"K_WORLD_89",UINT2NUM(SDLK_WORLD_89));
|
537
|
+
rb_define_const(mRubygame,"K_WORLD_90",UINT2NUM(SDLK_WORLD_90));
|
538
|
+
rb_define_const(mRubygame,"K_WORLD_91",UINT2NUM(SDLK_WORLD_91));
|
539
|
+
rb_define_const(mRubygame,"K_WORLD_92",UINT2NUM(SDLK_WORLD_92));
|
540
|
+
rb_define_const(mRubygame,"K_WORLD_93",UINT2NUM(SDLK_WORLD_93));
|
541
|
+
rb_define_const(mRubygame,"K_WORLD_94",UINT2NUM(SDLK_WORLD_94));
|
542
|
+
rb_define_const(mRubygame,"K_WORLD_95",UINT2NUM(SDLK_WORLD_95));
|
543
|
+
|
544
|
+
|
545
|
+
/* Numeric keypad symbols */
|
546
|
+
rb_define_const(mRubygame,"K_KP0",UINT2NUM(SDLK_KP0));
|
547
|
+
rb_define_const(mRubygame,"K_KP1",UINT2NUM(SDLK_KP1));
|
548
|
+
rb_define_const(mRubygame,"K_KP2",UINT2NUM(SDLK_KP2));
|
549
|
+
rb_define_const(mRubygame,"K_KP3",UINT2NUM(SDLK_KP3));
|
550
|
+
rb_define_const(mRubygame,"K_KP4",UINT2NUM(SDLK_KP4));
|
551
|
+
rb_define_const(mRubygame,"K_KP5",UINT2NUM(SDLK_KP5));
|
552
|
+
rb_define_const(mRubygame,"K_KP6",UINT2NUM(SDLK_KP6));
|
553
|
+
rb_define_const(mRubygame,"K_KP7",UINT2NUM(SDLK_KP7));
|
554
|
+
rb_define_const(mRubygame,"K_KP8",UINT2NUM(SDLK_KP8));
|
555
|
+
rb_define_const(mRubygame,"K_KP9",UINT2NUM(SDLK_KP9));
|
556
|
+
rb_define_const(mRubygame,"K_KP_PERIOD",UINT2NUM(SDLK_KP_PERIOD));
|
557
|
+
rb_define_const(mRubygame,"K_KP_DIVIDE",UINT2NUM(SDLK_KP_DIVIDE));
|
558
|
+
rb_define_const(mRubygame,"K_KP_MULTIPLY",UINT2NUM(SDLK_KP_MULTIPLY));
|
559
|
+
rb_define_const(mRubygame,"K_KP_MINUS",UINT2NUM(SDLK_KP_MINUS));
|
560
|
+
rb_define_const(mRubygame,"K_KP_PLUS",UINT2NUM(SDLK_KP_PLUS));
|
561
|
+
rb_define_const(mRubygame,"K_KP_ENTER",UINT2NUM(SDLK_KP_ENTER));
|
562
|
+
rb_define_const(mRubygame,"K_KP_EQUALS",UINT2NUM(SDLK_KP_EQUALS));
|
563
|
+
|
564
|
+
|
565
|
+
/* Arrows + Home/End pad */
|
566
|
+
rb_define_const(mRubygame,"K_UP",UINT2NUM(SDLK_UP));
|
567
|
+
rb_define_const(mRubygame,"K_DOWN",UINT2NUM(SDLK_DOWN));
|
568
|
+
rb_define_const(mRubygame,"K_RIGHT",UINT2NUM(SDLK_RIGHT));
|
569
|
+
rb_define_const(mRubygame,"K_LEFT",UINT2NUM(SDLK_LEFT));
|
570
|
+
rb_define_const(mRubygame,"K_INSERT",UINT2NUM(SDLK_INSERT));
|
571
|
+
rb_define_const(mRubygame,"K_HOME",UINT2NUM(SDLK_HOME));
|
572
|
+
rb_define_const(mRubygame,"K_END",UINT2NUM(SDLK_END));
|
573
|
+
rb_define_const(mRubygame,"K_PAGEUP",UINT2NUM(SDLK_PAGEUP));
|
574
|
+
rb_define_const(mRubygame,"K_PAGEDOWN",UINT2NUM(SDLK_PAGEDOWN));
|
575
|
+
|
576
|
+
|
577
|
+
/* Function keys */
|
578
|
+
rb_define_const(mRubygame,"K_F1",UINT2NUM(SDLK_F1));
|
579
|
+
rb_define_const(mRubygame,"K_F2",UINT2NUM(SDLK_F2));
|
580
|
+
rb_define_const(mRubygame,"K_F3",UINT2NUM(SDLK_F3));
|
581
|
+
rb_define_const(mRubygame,"K_F4",UINT2NUM(SDLK_F4));
|
582
|
+
rb_define_const(mRubygame,"K_F5",UINT2NUM(SDLK_F5));
|
583
|
+
rb_define_const(mRubygame,"K_F6",UINT2NUM(SDLK_F6));
|
584
|
+
rb_define_const(mRubygame,"K_F7",UINT2NUM(SDLK_F7));
|
585
|
+
rb_define_const(mRubygame,"K_F8",UINT2NUM(SDLK_F8));
|
586
|
+
rb_define_const(mRubygame,"K_F9",UINT2NUM(SDLK_F9));
|
587
|
+
rb_define_const(mRubygame,"K_F10",UINT2NUM(SDLK_F10));
|
588
|
+
rb_define_const(mRubygame,"K_F11",UINT2NUM(SDLK_F11));
|
589
|
+
rb_define_const(mRubygame,"K_F12",UINT2NUM(SDLK_F12));
|
590
|
+
rb_define_const(mRubygame,"K_F13",UINT2NUM(SDLK_F13));
|
591
|
+
rb_define_const(mRubygame,"K_F14",UINT2NUM(SDLK_F14));
|
592
|
+
rb_define_const(mRubygame,"K_F15",UINT2NUM(SDLK_F15));
|
593
|
+
|
594
|
+
|
595
|
+
/* Key state modifier keys */
|
596
|
+
rb_define_const(mRubygame,"K_NUMLOCK",UINT2NUM(SDLK_NUMLOCK));
|
597
|
+
rb_define_const(mRubygame,"K_CAPSLOCK",UINT2NUM(SDLK_CAPSLOCK));
|
598
|
+
rb_define_const(mRubygame,"K_SCROLLOCK",UINT2NUM(SDLK_SCROLLOCK));
|
599
|
+
rb_define_const(mRubygame,"K_RSHIFT",UINT2NUM(SDLK_RSHIFT));
|
600
|
+
rb_define_const(mRubygame,"K_LSHIFT",UINT2NUM(SDLK_LSHIFT));
|
601
|
+
rb_define_const(mRubygame,"K_RCTRL",UINT2NUM(SDLK_RCTRL));
|
602
|
+
rb_define_const(mRubygame,"K_LCTRL",UINT2NUM(SDLK_LCTRL));
|
603
|
+
rb_define_const(mRubygame,"K_RALT",UINT2NUM(SDLK_RALT));
|
604
|
+
rb_define_const(mRubygame,"K_LALT",UINT2NUM(SDLK_LALT));
|
605
|
+
rb_define_const(mRubygame,"K_RMETA",UINT2NUM(SDLK_RMETA));
|
606
|
+
rb_define_const(mRubygame,"K_LMETA",UINT2NUM(SDLK_LMETA));
|
607
|
+
rb_define_const(mRubygame,"K_LSUPER",UINT2NUM(SDLK_LSUPER));
|
608
|
+
rb_define_const(mRubygame,"K_RSUPER",UINT2NUM(SDLK_RSUPER));
|
609
|
+
rb_define_const(mRubygame,"K_MODE",UINT2NUM(SDLK_MODE));
|
610
|
+
|
611
|
+
|
612
|
+
/* Miscellaneous keys */
|
613
|
+
rb_define_const(mRubygame,"K_HELP",UINT2NUM(SDLK_HELP));
|
614
|
+
rb_define_const(mRubygame,"K_PRINT",UINT2NUM(SDLK_PRINT));
|
615
|
+
rb_define_const(mRubygame,"K_SYSREQ",UINT2NUM(SDLK_SYSREQ));
|
616
|
+
rb_define_const(mRubygame,"K_BREAK",UINT2NUM(SDLK_BREAK));
|
617
|
+
rb_define_const(mRubygame,"K_MENU",UINT2NUM(SDLK_MENU));
|
618
|
+
rb_define_const(mRubygame,"K_POWER",UINT2NUM(SDLK_POWER));
|
619
|
+
rb_define_const(mRubygame,"K_EURO",UINT2NUM(SDLK_EURO));
|
620
|
+
rb_define_const(mRubygame,"K_LAST",UINT2NUM(SDLK_LAST));
|
621
|
+
|
622
|
+
|
623
|
+
#if 0
|
624
|
+
/* key mods */
|
625
|
+
/* rb_define_const(mRubygame,"K_MOD_NONE",UINT2NUM(KMOD_NONE)); */
|
626
|
+
/* rb_define_const(mRubygame,"K_MOD_LSHIFT",UINT2NUM(KMOD_LSHIFT)); */
|
627
|
+
/* rb_define_const(mRubygame,"K_MOD_RSHIFT",UINT2NUM(KMOD_RSHIFT)); */
|
628
|
+
/* rb_define_const(mRubygame,"K_MOD_LCTRL",UINT2NUM(KMOD_LCTRL)); */
|
629
|
+
/* rb_define_const(mRubygame,"K_MOD_RCTRL",UINT2NUM(KMOD_RCTRL)); */
|
630
|
+
/* rb_define_const(mRubygame,"K_MOD_LALT",UINT2NUM(KMOD_LALT)); */
|
631
|
+
/* rb_define_const(mRubygame,"K_MOD_RALT",UINT2NUM(KMOD_RALT)); */
|
632
|
+
/* rb_define_const(mRubygame,"K_MOD_LMETA",UINT2NUM(KMOD_LMETA)); */
|
633
|
+
/* rb_define_const(mRubygame,"K_MOD_RMETA",UINT2NUM(KMOD_RMETA)); */
|
634
|
+
/* rb_define_const(mRubygame,"K_MOD_NUM",UINT2NUM(KMOD_NUM)); */
|
635
|
+
/* rb_define_const(mRubygame,"K_MOD_CAPS",UINT2NUM(KMOD_CAPS)); */
|
636
|
+
/* rb_define_const(mRubygame,"K_MOD_MODE",UINT2NUM(KMOD_MODE)); */
|
637
|
+
/* rb_define_const(mRubygame,"K_MOD_RESERVED",UINT2NUM(KMOD_RESERVED)); */
|
638
|
+
|
639
|
+
/* rb_define_const(mRubygame,"K_MOD_CTRL",UINT2NUM(KMOD_CTRL)); */
|
640
|
+
/* rb_define_const(mRubygame,"K_MOD_SHIFT",UINT2NUM(KMOD_SHIFT)); */
|
641
|
+
/* rb_define_const(mRubygame,"K_MOD_ALT",UINT2NUM(KMOD_ALT)); */
|
642
|
+
/* rb_define_const(mRubygame,"K_MOD_META",UINT2NUM(KMOD_META)); */
|
643
|
+
#endif
|
644
|
+
}
|