allegro4r 0.0.1-x86-mswin32-60
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/History.txt +4 -0
- data/Manifest.txt +59 -0
- data/README.txt +94 -0
- data/examples/exdbuf.rb +58 -0
- data/examples/exfixed.rb +46 -0
- data/examples/exflame.rb +200 -0
- data/examples/exflip.rb +87 -0
- data/examples/exfont.rb +70 -0
- data/examples/exhello.rb +46 -0
- data/examples/exjoy.rb +206 -0
- data/examples/exkeys.rb +216 -0
- data/examples/exmem.rb +50 -0
- data/examples/exmidi.rb +97 -0
- data/examples/exmouse.rb +149 -0
- data/examples/expal.rb +70 -0
- data/examples/expat.rb +62 -0
- data/examples/exsample.rb +89 -0
- data/examples/extimer.rb +84 -0
- data/examples/unifont.dat +0 -0
- data/ext/a4r_API_BITMAP.c +27 -0
- data/ext/a4r_API_DIGI_DRIVER.c +14 -0
- data/ext/a4r_API_GFX_DRIVER.c +14 -0
- data/ext/a4r_API_JOYSTICK_AXIS_INFO.c +53 -0
- data/ext/a4r_API_JOYSTICK_BUTTON_INFO.c +27 -0
- data/ext/a4r_API_JOYSTICK_DRIVER.c +14 -0
- data/ext/a4r_API_JOYSTICK_INFO.c +84 -0
- data/ext/a4r_API_JOYSTICK_STICK_INFO.c +62 -0
- data/ext/a4r_API_KEYBOARD_DRIVER.c +14 -0
- data/ext/a4r_API_MIDI_DRIVER.c +14 -0
- data/ext/a4r_API_MOUSE_DRIVER.c +14 -0
- data/ext/a4r_API_PALETTE.c +63 -0
- data/ext/a4r_API_RGB.c +118 -0
- data/ext/a4r_API_TIMER_DRIVER.c +14 -0
- data/ext/a4r_API_bitmap_objects.c +310 -0
- data/ext/a4r_API_blitting_and_sprites.c +86 -0
- data/ext/a4r_API_digital_sample_routines.c +83 -0
- data/ext/a4r_API_direct_access_to_video_memory.c +102 -0
- data/ext/a4r_API_drawing_primitives.c +114 -0
- data/ext/a4r_API_file_and_compression_routines.c +27 -0
- data/ext/a4r_API_fixed_point_math_routines.c +98 -0
- data/ext/a4r_API_fonts.c +147 -0
- data/ext/a4r_API_graphics_modes.c +155 -0
- data/ext/a4r_API_joystick_routines.c +213 -0
- data/ext/a4r_API_keyboard_routines.c +420 -0
- data/ext/a4r_API_misc.c +133 -0
- data/ext/a4r_API_mouse_routines.c +220 -0
- data/ext/a4r_API_music_routines_midi.c +147 -0
- data/ext/a4r_API_palette_routines.c +112 -0
- data/ext/a4r_API_sound_init_routines.c +29 -0
- data/ext/a4r_API_text_output.c +178 -0
- data/ext/a4r_API_timer_routines.c +250 -0
- data/ext/a4r_API_transparency_and_patterned_drawing.c +87 -0
- data/ext/a4r_API_truecolor_pixel_formats.c +44 -0
- data/ext/a4r_API_unicode_routines.c +53 -0
- data/ext/a4r_API_using_allegro.c +98 -0
- data/ext/allegro4r.c +866 -0
- data/ext/allegro4r.h +311 -0
- data/ext/allegro4r.so +0 -0
- data/ext/extconf.rb +11 -0
- metadata +113 -0
data/ext/allegro4r.h
ADDED
@@ -0,0 +1,311 @@
|
|
1
|
+
/* ______ ___ ___ __ __
|
2
|
+
* /\ _ \ /\_ \ /\_ \ /\ \\ \
|
3
|
+
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___\ \ \\ \ _ __
|
4
|
+
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ \ \\ \_ /\`'__\
|
5
|
+
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ \__ ,__\ \ \/
|
6
|
+
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/\/_/\_\_/\ \_\
|
7
|
+
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ \/_/ \/_/
|
8
|
+
* /\____/
|
9
|
+
* \_/__/
|
10
|
+
*
|
11
|
+
* Main header file for the Allegro4r Ruby binding to the Allegro library.
|
12
|
+
*
|
13
|
+
* By Jason Frey.
|
14
|
+
*/
|
15
|
+
|
16
|
+
#ifndef __ALLEGRO4R_H__
|
17
|
+
#define __ALLEGRO4R_H__
|
18
|
+
|
19
|
+
#include <allegro.h>
|
20
|
+
|
21
|
+
#if defined _WIN32 || defined __CYGWIN__
|
22
|
+
#include <winalleg.h>
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#include <ruby.h>
|
26
|
+
|
27
|
+
extern ID CALL_ID;
|
28
|
+
|
29
|
+
// Allegro4r modules and classes
|
30
|
+
extern VALUE mAllegro4r;
|
31
|
+
extern VALUE mAllegro4r_API;
|
32
|
+
|
33
|
+
extern VALUE cAPI_BITMAP;
|
34
|
+
extern VALUE cAPI_JOYSTICK_INFO;
|
35
|
+
extern VALUE cAPI_JOYSTICK_BUTTON_INFO;
|
36
|
+
extern VALUE cAPI_JOYSTICK_STICK_INFO;
|
37
|
+
extern VALUE cAPI_JOYSTICK_AXIS_INFO;
|
38
|
+
extern VALUE cAPI_PALETTE;
|
39
|
+
extern VALUE cAPI_RGB;
|
40
|
+
extern VALUE cAPI_FONT;
|
41
|
+
extern VALUE cAPI_SAMPLE;
|
42
|
+
extern VALUE cAPI_MIDI;
|
43
|
+
|
44
|
+
extern VALUE cAPI_GFX_DRIVER;
|
45
|
+
extern VALUE cAPI_MOUSE_DRIVER;
|
46
|
+
extern VALUE cAPI_TIMER_DRIVER;
|
47
|
+
extern VALUE cAPI_KEYBOARD_DRIVER;
|
48
|
+
extern VALUE cAPI_JOYSTICK_DRIVER;
|
49
|
+
extern VALUE cAPI_DIGI_DRIVER;
|
50
|
+
extern VALUE cAPI_MIDI_DRIVER;
|
51
|
+
|
52
|
+
// Method definitions for structures and types defined by Allegro
|
53
|
+
|
54
|
+
// BITMAP
|
55
|
+
extern VALUE a4r_API_BITMAP_h_get(VALUE self);
|
56
|
+
extern VALUE a4r_API_BITMAP_w_get(VALUE self);
|
57
|
+
|
58
|
+
// JOYSTICK_INFO
|
59
|
+
extern VALUE a4r_API_JOYSTICK_INFO_flags(VALUE self);
|
60
|
+
extern VALUE a4r_API_JOYSTICK_INFO_num_sticks(VALUE self);
|
61
|
+
extern VALUE a4r_API_JOYSTICK_INFO_num_buttons(VALUE self);
|
62
|
+
extern VALUE a4r_API_JOYSTICK_INFO_stick(VALUE self);
|
63
|
+
extern VALUE a4r_API_JOYSTICK_INFO_button(VALUE self);
|
64
|
+
|
65
|
+
// JOYSTICK_BUTTON_INFO
|
66
|
+
extern VALUE a4r_API_JOYSTICK_BUTTON_INFO_b(VALUE self);
|
67
|
+
extern VALUE a4r_API_JOYSTICK_BUTTON_INFO_name(VALUE self);
|
68
|
+
|
69
|
+
// JOYSTICK_STICK_INFO
|
70
|
+
extern VALUE a4r_API_JOYSTICK_STICK_INFO_flags(VALUE self);
|
71
|
+
extern VALUE a4r_API_JOYSTICK_STICK_INFO_num_axis(VALUE self);
|
72
|
+
extern VALUE a4r_API_JOYSTICK_STICK_INFO_axis(VALUE self);
|
73
|
+
extern VALUE a4r_API_JOYSTICK_STICK_INFO_name(VALUE self);
|
74
|
+
|
75
|
+
// JOYSTICK_AXIS_INFO
|
76
|
+
extern VALUE a4r_API_JOYSTICK_AXIS_INFO_pos(VALUE self);
|
77
|
+
extern VALUE a4r_API_JOYSTICK_AXIS_INFO_d1(VALUE self);
|
78
|
+
extern VALUE a4r_API_JOYSTICK_AXIS_INFO_d2(VALUE self);
|
79
|
+
extern VALUE a4r_API_JOYSTICK_AXIS_INFO_name(VALUE self);
|
80
|
+
|
81
|
+
// PALETTE
|
82
|
+
extern void a4r_API_PALETTE_free(void *palette);
|
83
|
+
extern VALUE a4r_API_PALETTE_alloc(VALUE klass);
|
84
|
+
extern VALUE a4r_API_PALETTE_initialize_copy(VALUE copy, VALUE orig);
|
85
|
+
extern VALUE a4r_API_PALETTE_getter(VALUE self, VALUE index);
|
86
|
+
extern VALUE a4r_API_PALETTE_setter(VALUE self, VALUE index, VALUE val);
|
87
|
+
|
88
|
+
// RGB
|
89
|
+
extern void a4r_API_RGB_free(void *rgb);
|
90
|
+
extern VALUE a4r_API_RGB_alloc(VALUE klass);
|
91
|
+
extern VALUE a4r_API_RGB_initialize_copy(VALUE copy, VALUE orig);
|
92
|
+
extern VALUE a4r_API_RGB_r_get(VALUE self);
|
93
|
+
extern VALUE a4r_API_RGB_r_set(VALUE self, VALUE val);
|
94
|
+
extern VALUE a4r_API_RGB_g_get(VALUE self);
|
95
|
+
extern VALUE a4r_API_RGB_g_set(VALUE self, VALUE val);
|
96
|
+
extern VALUE a4r_API_RGB_b_get(VALUE self);
|
97
|
+
extern VALUE a4r_API_RGB_b_set(VALUE self, VALUE val);
|
98
|
+
|
99
|
+
// GFX_DRIVER
|
100
|
+
extern VALUE a4r_API_GFX_DRIVER_name_get(VALUE self);
|
101
|
+
|
102
|
+
// MOUSE_DRIVER
|
103
|
+
extern VALUE a4r_API_MOUSE_DRIVER_name_get(VALUE self);
|
104
|
+
|
105
|
+
// TIMER_DRIVER
|
106
|
+
extern VALUE a4r_API_TIMER_DRIVER_name_get(VALUE self);
|
107
|
+
|
108
|
+
// KEYBOARD_DRIVER
|
109
|
+
extern VALUE a4r_API_KEYBOARD_DRIVER_name_get(VALUE self);
|
110
|
+
|
111
|
+
// JOYSTICK_DRIVER
|
112
|
+
extern VALUE a4r_API_JOYSTICK_DRIVER_name_get(VALUE self);
|
113
|
+
|
114
|
+
// DIGI_DRIVER
|
115
|
+
extern VALUE a4r_API_DIGI_DRIVER_name_get(VALUE self);
|
116
|
+
|
117
|
+
// MIDI_DRIVER
|
118
|
+
extern VALUE a4r_API_MIDI_DRIVER_name_get(VALUE self);
|
119
|
+
|
120
|
+
// Ruby methods for routines defined by Allegro
|
121
|
+
|
122
|
+
// Misc
|
123
|
+
extern VALUE a4r_API_MIN(VALUE self, VALUE x, VALUE y);
|
124
|
+
extern VALUE a4r_API_ABS(VALUE self, VALUE x);
|
125
|
+
extern VALUE a4r_API_AL_RAND(VALUE self);
|
126
|
+
extern VALUE a4r_API_gfx_driver(VALUE self);
|
127
|
+
extern VALUE a4r_API_mouse_driver(VALUE self);
|
128
|
+
extern VALUE a4r_API_timer_driver(VALUE self);
|
129
|
+
extern VALUE a4r_API_keyboard_driver(VALUE self);
|
130
|
+
extern VALUE a4r_API_joystick_driver(VALUE self);
|
131
|
+
extern VALUE a4r_API_digi_driver(VALUE self);
|
132
|
+
extern VALUE a4r_API_midi_driver(VALUE self);
|
133
|
+
|
134
|
+
// Using Allegro
|
135
|
+
extern VALUE a4r_API_allegro_init(VALUE self);
|
136
|
+
extern VALUE a4r_API_allegro_exit(VALUE self);
|
137
|
+
extern VALUE a4r_API_allegro_error(VALUE self);
|
138
|
+
extern VALUE a4r_API_allegro_message(VALUE self, VALUE text);
|
139
|
+
|
140
|
+
// Unicode routines
|
141
|
+
extern VALUE a4r_API_usprintf(VALUE self, VALUE format);
|
142
|
+
extern VALUE a4r_API_ustrzncpy(VALUE self, VALUE src, VALUE n);
|
143
|
+
|
144
|
+
// Mouse routines
|
145
|
+
extern VALUE a4r_API_install_mouse(VALUE self);
|
146
|
+
extern VALUE a4r_API_poll_mouse(VALUE self);
|
147
|
+
extern VALUE a4r_API_mouse_x(VALUE self);
|
148
|
+
extern VALUE a4r_API_mouse_y(VALUE self);
|
149
|
+
extern VALUE a4r_API_mouse_z(VALUE self);
|
150
|
+
extern VALUE a4r_API_mouse_w(VALUE self);
|
151
|
+
extern VALUE a4r_API_mouse_b(VALUE self);
|
152
|
+
extern VALUE a4r_API_show_mouse(VALUE self, VALUE bmp);
|
153
|
+
extern VALUE a4r_API_get_mouse_mickeys(VALUE self);
|
154
|
+
extern VALUE a4r_API_set_mouse_sprite(VALUE self, VALUE bmp);
|
155
|
+
extern VALUE a4r_API_set_mouse_sprite_focus(VALUE self, VALUE x, VALUE y);
|
156
|
+
|
157
|
+
// Timer routines
|
158
|
+
extern VALUE a4r_API_install_timer(VALUE self);
|
159
|
+
extern VALUE a4r_API_install_int(VALUE self, VALUE proc, VALUE speed);
|
160
|
+
extern VALUE a4r_API_install_int_ex(VALUE self, VALUE proc, VALUE speed);
|
161
|
+
extern VALUE a4r_API_LOCK_VARIABLE(VALUE self, VALUE variable_name);
|
162
|
+
extern VALUE a4r_API_LOCK_FUNCTION(VALUE self, VALUE function_name);
|
163
|
+
extern VALUE a4r_API_retrace_count(VALUE self);
|
164
|
+
extern VALUE a4r_API_rest(VALUE self, VALUE time);
|
165
|
+
extern VALUE a4r_API_SECS_TO_TIMER(VALUE self, VALUE secs);
|
166
|
+
extern VALUE a4r_API_MSEC_TO_TIMER(VALUE self, VALUE msec);
|
167
|
+
extern VALUE a4r_API_BPS_TO_TIMER(VALUE self, VALUE bps);
|
168
|
+
extern VALUE a4r_API_BPM_TO_TIMER(VALUE self, VALUE bpm);
|
169
|
+
|
170
|
+
// Predefined timer interrupt routines
|
171
|
+
#define MAX_TIMER_COUNTERS 10
|
172
|
+
extern volatile int timer_counters[MAX_TIMER_COUNTERS];
|
173
|
+
extern VALUE timer_counter_names;
|
174
|
+
|
175
|
+
extern void timer_counter_incr(void *param);
|
176
|
+
extern VALUE find_timer_counter(VALUE name);
|
177
|
+
extern VALUE find_free_timer_counter();
|
178
|
+
extern VALUE a4r_API_timer_counter_get(VALUE self, VALUE name);
|
179
|
+
|
180
|
+
// Keyboard routines
|
181
|
+
extern VALUE a4r_API_install_keyboard(VALUE self);
|
182
|
+
extern VALUE a4r_API_poll_keyboard(VALUE self);
|
183
|
+
extern VALUE a4r_API_key(VALUE self);
|
184
|
+
extern VALUE a4r_API_key_shifts(VALUE self);
|
185
|
+
extern VALUE a4r_API_keypressed(VALUE self);
|
186
|
+
extern VALUE a4r_API_readkey(VALUE self);
|
187
|
+
extern VALUE a4r_API_ureadkey(VALUE self, VALUE scancode);
|
188
|
+
extern VALUE a4r_API_scancode_to_name(VALUE self, VALUE scancode);
|
189
|
+
extern VALUE a4r_API_keyboard_callback_set(VALUE self, VALUE proc);
|
190
|
+
extern VALUE a4r_API_keyboard_lowlevel_callback_set(VALUE self, VALUE proc);
|
191
|
+
extern VALUE a4r_API_clear_keybuf(VALUE self);
|
192
|
+
|
193
|
+
// Predefined keyboard callback routines
|
194
|
+
extern VALUE keyboard_callback_proc;
|
195
|
+
extern VALUE keyboard_lowlevel_callback_proc;
|
196
|
+
extern int keyboard_callback_method(int key);
|
197
|
+
extern void keyboard_lowlevel_callback_method(int scancode);
|
198
|
+
|
199
|
+
// Joystick routines
|
200
|
+
extern VALUE a4r_API_install_joystick(VALUE self, VALUE type);
|
201
|
+
extern VALUE a4r_API_poll_joystick(VALUE self);
|
202
|
+
extern VALUE a4r_API_num_joysticks(VALUE self);
|
203
|
+
extern VALUE a4r_API_joy(VALUE self);
|
204
|
+
extern VALUE a4r_API_calibrate_joystick_name(VALUE self, VALUE n);
|
205
|
+
extern VALUE a4r_API_calibrate_joystick(VALUE self, VALUE n);
|
206
|
+
|
207
|
+
// Graphics modes
|
208
|
+
extern VALUE a4r_API_set_gfx_mode(VALUE self, VALUE card, VALUE w, VALUE h, VALUE v_w, VALUE v_h);
|
209
|
+
extern VALUE a4r_API_set_display_switch_mode(VALUE self, VALUE mode);
|
210
|
+
extern VALUE a4r_API_show_video_bitmap(VALUE self, VALUE bitmap);
|
211
|
+
extern VALUE a4r_API_vsync(VALUE self);
|
212
|
+
|
213
|
+
// Bitmap objects
|
214
|
+
extern VALUE a4r_API_screen(VALUE self);
|
215
|
+
extern VALUE a4r_API_SCREEN_W(VALUE self);
|
216
|
+
extern VALUE a4r_API_SCREEN_H(VALUE self);
|
217
|
+
extern VALUE a4r_API_create_bitmap(VALUE self, VALUE width, VALUE height);
|
218
|
+
extern VALUE a4r_API_create_sub_bitmap(VALUE self, VALUE parent, VALUE x, VALUE y, VALUE width, VALUE height);
|
219
|
+
extern VALUE a4r_API_create_video_bitmap(VALUE self, VALUE width, VALUE height);
|
220
|
+
extern VALUE a4r_API_destroy_bitmap(VALUE self, VALUE bitmap);
|
221
|
+
extern VALUE a4r_API_bitmap_mask_color(VALUE self, VALUE bmp);
|
222
|
+
extern VALUE a4r_API_acquire_bitmap(VALUE self, VALUE bmp);
|
223
|
+
extern VALUE a4r_API_release_bitmap(VALUE self, VALUE bmp);
|
224
|
+
extern VALUE a4r_API_acquire_screen(VALUE self);
|
225
|
+
extern VALUE a4r_API_release_screen(VALUE self);
|
226
|
+
|
227
|
+
// Palette routines
|
228
|
+
extern VALUE a4r_API_set_palette(VALUE self, VALUE p);
|
229
|
+
extern VALUE a4r_API_get_palette(VALUE self, VALUE p);
|
230
|
+
extern VALUE a4r_API_default_palette(VALUE self);
|
231
|
+
extern VALUE a4r_API_black_palette(VALUE self);
|
232
|
+
extern VALUE a4r_API_desktop_palette(VALUE self);
|
233
|
+
|
234
|
+
// Truecolor pixel formats
|
235
|
+
extern VALUE a4r_API_makecol(VALUE self, VALUE r, VALUE g, VALUE b);
|
236
|
+
extern VALUE a4r_API_palette_color(VALUE self);
|
237
|
+
|
238
|
+
// Drawing primitives
|
239
|
+
extern VALUE a4r_API_clear_bitmap(VALUE self, VALUE bitmap);
|
240
|
+
extern VALUE a4r_API_clear_to_color(VALUE self, VALUE bitmap, VALUE color);
|
241
|
+
extern VALUE a4r_API_putpixel(VALUE self, VALUE bmp, VALUE x, VALUE y, VALUE color);
|
242
|
+
extern VALUE a4r_API_getpixel(VALUE self, VALUE bmp, VALUE x, VALUE y);
|
243
|
+
extern VALUE a4r_API_rectfill(VALUE self, VALUE bmp, VALUE x1, VALUE y1, VALUE x2, VALUE y2, VALUE color);
|
244
|
+
extern VALUE a4r_API_circle(VALUE self, VALUE bmp, VALUE x, VALUE y, VALUE radius, VALUE color);
|
245
|
+
extern VALUE a4r_API_circlefill(VALUE self, VALUE bmp, VALUE x, VALUE y, VALUE radius, VALUE color);
|
246
|
+
|
247
|
+
// Blitting and sprites
|
248
|
+
extern VALUE a4r_API_blit(VALUE self, VALUE source, VALUE dest, VALUE source_x, VALUE source_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height);
|
249
|
+
extern VALUE a4r_API_masked_blit(VALUE self, VALUE source, VALUE dest, VALUE source_x, VALUE source_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height);
|
250
|
+
|
251
|
+
// Fonts
|
252
|
+
extern VALUE a4r_API_load_font(VALUE self, VALUE filename, VALUE pal, VALUE param);
|
253
|
+
extern VALUE a4r_API_destroy_font(VALUE self, VALUE f);
|
254
|
+
extern VALUE a4r_API_extract_font_range(VALUE self, VALUE f, VALUE begin, VALUE end);
|
255
|
+
extern VALUE a4r_API_merge_fonts(VALUE self, VALUE f1, VALUE f2);
|
256
|
+
|
257
|
+
// Text output
|
258
|
+
extern VALUE a4r_API_font(VALUE self);
|
259
|
+
extern VALUE a4r_API_font_set(VALUE self, VALUE f);
|
260
|
+
extern VALUE a4r_API_text_length(VALUE self, VALUE f, VALUE str);
|
261
|
+
extern VALUE a4r_API_text_height(VALUE self, VALUE f);
|
262
|
+
extern VALUE a4r_API_textout_ex(VALUE self, VALUE bmp, VALUE f, VALUE s, VALUE x, VALUE y, VALUE color, VALUE bg);
|
263
|
+
extern VALUE a4r_API_textout_centre_ex(VALUE self, VALUE bmp, VALUE f, VALUE s, VALUE x, VALUE y, VALUE color, VALUE bg);
|
264
|
+
extern VALUE a4r_API_textprintf_ex(VALUE self, VALUE bmp, VALUE f, VALUE x, VALUE y, VALUE color, VALUE bg, VALUE fmt);
|
265
|
+
extern VALUE a4r_API_textprintf_centre_ex(VALUE self, VALUE bmp, VALUE f, VALUE x, VALUE y, VALUE color, VALUE bg, VALUE fmt);
|
266
|
+
extern VALUE a4r_API_textprintf_right_ex(VALUE self, VALUE bmp, VALUE f, VALUE x, VALUE y, VALUE color, VALUE bg, VALUE fmt);
|
267
|
+
|
268
|
+
// Transparency and patterened drawing
|
269
|
+
extern VALUE a4r_API_drawing_mode(VALUE self, VALUE mode, VALUE pattern, VALUE x_anchor, VALUE y_anchor);
|
270
|
+
extern VALUE a4r_API_solid_mode(VALUE self);
|
271
|
+
|
272
|
+
// Direct access to video memory
|
273
|
+
extern VALUE a4r_API_bmp_select(VALUE self, VALUE bmp);
|
274
|
+
extern VALUE a4r_API_bmp_read8(VALUE self, VALUE addr);
|
275
|
+
extern VALUE a4r_API_bmp_read32(VALUE self, VALUE addr);
|
276
|
+
extern VALUE a4r_API_bmp_write8(VALUE self, VALUE addr, VALUE c);
|
277
|
+
extern VALUE a4r_API_bmp_write32(VALUE self, VALUE addr, VALUE c);
|
278
|
+
extern VALUE a4r_API_bmp_write_line(VALUE self, VALUE bmp, VALUE line);
|
279
|
+
extern VALUE a4r_API_bmp_read_line(VALUE self, VALUE bmp, VALUE line);
|
280
|
+
extern VALUE a4r_API_bmp_unwrite_line(VALUE self, VALUE bmp);
|
281
|
+
|
282
|
+
// Sound init routines
|
283
|
+
extern VALUE a4r_API_install_sound(VALUE self, VALUE digi, VALUE midi, VALUE cfg_path);
|
284
|
+
|
285
|
+
// Digital sample routines
|
286
|
+
extern VALUE a4r_API_load_sample(VALUE self, VALUE filename);
|
287
|
+
extern VALUE a4r_API_destroy_sample(VALUE self, VALUE spl);
|
288
|
+
extern VALUE a4r_API_play_sample(VALUE self, VALUE spl, VALUE vol, VALUE pan, VALUE freq, VALUE loop);
|
289
|
+
extern VALUE a4r_API_adjust_sample(VALUE self, VALUE spl, VALUE vol, VALUE pan, VALUE freq, VALUE loop);
|
290
|
+
|
291
|
+
// Music routines (MIDI)
|
292
|
+
extern VALUE a4r_API_load_midi(VALUE self, VALUE filename);
|
293
|
+
extern VALUE a4r_API_destroy_midi(VALUE self, VALUE midi);
|
294
|
+
extern VALUE a4r_API_play_midi(VALUE self, VALUE midi, VALUE loop);
|
295
|
+
extern VALUE a4r_API_midi_pause(VALUE self);
|
296
|
+
extern VALUE a4r_API_midi_resume(VALUE self);
|
297
|
+
extern VALUE a4r_API_get_midi_length(VALUE self, VALUE midi);
|
298
|
+
extern VALUE a4r_API_midi_pos(VALUE self);
|
299
|
+
extern VALUE a4r_API_midi_time(VALUE self);
|
300
|
+
|
301
|
+
// File and compression routines
|
302
|
+
extern VALUE a4r_API_get_filename(VALUE self, VALUE path);
|
303
|
+
|
304
|
+
// Fixed point math routines
|
305
|
+
extern VALUE a4r_API_itofix(VALUE self, VALUE x);
|
306
|
+
extern VALUE a4r_API_ftofix(VALUE self, VALUE x);
|
307
|
+
extern VALUE a4r_API_fixtof(VALUE self, VALUE x);
|
308
|
+
extern VALUE a4r_API_fixmul(VALUE self, VALUE x, VALUE y);
|
309
|
+
extern VALUE a4r_API_fixsqrt(VALUE self, VALUE x);
|
310
|
+
|
311
|
+
#endif //__ALLEGRO4R_H__
|
data/ext/allegro4r.so
ADDED
Binary file
|
data/ext/extconf.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
ext_name = 'allegro4r'
|
3
|
+
dir_config('allegro')
|
4
|
+
raise "Allegro libraries are not found." unless have_library('alleg')
|
5
|
+
|
6
|
+
if RUBY_PLATFORM !~ /mingw/
|
7
|
+
$LDFLAGS << ' ' + `allegro-config --libs`.chomp
|
8
|
+
$CFLAGS << ' ' + `allegro-config --cflags`.chomp
|
9
|
+
end
|
10
|
+
|
11
|
+
create_makefile(ext_name)
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: allegro4r
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: x86-mswin32-60
|
6
|
+
authors:
|
7
|
+
- Jason Frey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-04-17 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Ruby binding for the Allegro game programming library as well as more stuff
|
17
|
+
email: fryguy9 @nospam@ yahoo.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.txt
|
24
|
+
- History.txt
|
25
|
+
files:
|
26
|
+
- ext/a4r_API_BITMAP.c
|
27
|
+
- ext/a4r_API_bitmap_objects.c
|
28
|
+
- ext/a4r_API_blitting_and_sprites.c
|
29
|
+
- ext/a4r_API_digital_sample_routines.c
|
30
|
+
- ext/a4r_API_DIGI_DRIVER.c
|
31
|
+
- ext/a4r_API_direct_access_to_video_memory.c
|
32
|
+
- ext/a4r_API_drawing_primitives.c
|
33
|
+
- ext/a4r_API_file_and_compression_routines.c
|
34
|
+
- ext/a4r_API_fixed_point_math_routines.c
|
35
|
+
- ext/a4r_API_fonts.c
|
36
|
+
- ext/a4r_API_GFX_DRIVER.c
|
37
|
+
- ext/a4r_API_graphics_modes.c
|
38
|
+
- ext/a4r_API_JOYSTICK_AXIS_INFO.c
|
39
|
+
- ext/a4r_API_JOYSTICK_BUTTON_INFO.c
|
40
|
+
- ext/a4r_API_JOYSTICK_DRIVER.c
|
41
|
+
- ext/a4r_API_JOYSTICK_INFO.c
|
42
|
+
- ext/a4r_API_joystick_routines.c
|
43
|
+
- ext/a4r_API_JOYSTICK_STICK_INFO.c
|
44
|
+
- ext/a4r_API_KEYBOARD_DRIVER.c
|
45
|
+
- ext/a4r_API_keyboard_routines.c
|
46
|
+
- ext/a4r_API_MIDI_DRIVER.c
|
47
|
+
- ext/a4r_API_misc.c
|
48
|
+
- ext/a4r_API_MOUSE_DRIVER.c
|
49
|
+
- ext/a4r_API_mouse_routines.c
|
50
|
+
- ext/a4r_API_music_routines_midi.c
|
51
|
+
- ext/a4r_API_PALETTE.c
|
52
|
+
- ext/a4r_API_palette_routines.c
|
53
|
+
- ext/a4r_API_RGB.c
|
54
|
+
- ext/a4r_API_sound_init_routines.c
|
55
|
+
- ext/a4r_API_text_output.c
|
56
|
+
- ext/a4r_API_TIMER_DRIVER.c
|
57
|
+
- ext/a4r_API_timer_routines.c
|
58
|
+
- ext/a4r_API_transparency_and_patterned_drawing.c
|
59
|
+
- ext/a4r_API_truecolor_pixel_formats.c
|
60
|
+
- ext/a4r_API_unicode_routines.c
|
61
|
+
- ext/a4r_API_using_allegro.c
|
62
|
+
- ext/allegro4r.c
|
63
|
+
- ext/allegro4r.h
|
64
|
+
- ext/extconf.rb
|
65
|
+
- examples/exdbuf.rb
|
66
|
+
- examples/exfixed.rb
|
67
|
+
- examples/exflame.rb
|
68
|
+
- examples/exflip.rb
|
69
|
+
- examples/exfont.rb
|
70
|
+
- examples/exhello.rb
|
71
|
+
- examples/exjoy.rb
|
72
|
+
- examples/exkeys.rb
|
73
|
+
- examples/exmem.rb
|
74
|
+
- examples/exmidi.rb
|
75
|
+
- examples/exmouse.rb
|
76
|
+
- examples/expal.rb
|
77
|
+
- examples/expat.rb
|
78
|
+
- examples/exsample.rb
|
79
|
+
- examples/extimer.rb
|
80
|
+
- examples/unifont.dat
|
81
|
+
- Manifest.txt
|
82
|
+
- README.txt
|
83
|
+
- History.txt
|
84
|
+
- ext/allegro4r.so
|
85
|
+
has_rdoc: true
|
86
|
+
homepage: http://allegro4r.rubyforge.org
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options:
|
89
|
+
- --main
|
90
|
+
- README.txt
|
91
|
+
require_paths:
|
92
|
+
- ext
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: "0"
|
98
|
+
version:
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: "0"
|
104
|
+
version:
|
105
|
+
requirements:
|
106
|
+
- Allegro 4.2.2 (http://alleg.sourceforge.net/)
|
107
|
+
rubyforge_project: allegro4r
|
108
|
+
rubygems_version: 1.3.1
|
109
|
+
signing_key:
|
110
|
+
specification_version: 2
|
111
|
+
summary: Ruby binding for the Allegro game programming library
|
112
|
+
test_files: []
|
113
|
+
|