allegro4r 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +58 -0
  3. data/README.txt +94 -0
  4. data/examples/exdbuf.rb +58 -0
  5. data/examples/exfixed.rb +46 -0
  6. data/examples/exflame.rb +200 -0
  7. data/examples/exflip.rb +87 -0
  8. data/examples/exfont.rb +70 -0
  9. data/examples/exhello.rb +46 -0
  10. data/examples/exjoy.rb +206 -0
  11. data/examples/exkeys.rb +216 -0
  12. data/examples/exmem.rb +50 -0
  13. data/examples/exmidi.rb +97 -0
  14. data/examples/exmouse.rb +149 -0
  15. data/examples/expal.rb +70 -0
  16. data/examples/expat.rb +62 -0
  17. data/examples/exsample.rb +89 -0
  18. data/examples/extimer.rb +84 -0
  19. data/examples/unifont.dat +0 -0
  20. data/ext/a4r_API_BITMAP.c +27 -0
  21. data/ext/a4r_API_DIGI_DRIVER.c +14 -0
  22. data/ext/a4r_API_GFX_DRIVER.c +14 -0
  23. data/ext/a4r_API_JOYSTICK_AXIS_INFO.c +53 -0
  24. data/ext/a4r_API_JOYSTICK_BUTTON_INFO.c +27 -0
  25. data/ext/a4r_API_JOYSTICK_DRIVER.c +14 -0
  26. data/ext/a4r_API_JOYSTICK_INFO.c +84 -0
  27. data/ext/a4r_API_JOYSTICK_STICK_INFO.c +62 -0
  28. data/ext/a4r_API_KEYBOARD_DRIVER.c +14 -0
  29. data/ext/a4r_API_MIDI_DRIVER.c +14 -0
  30. data/ext/a4r_API_MOUSE_DRIVER.c +14 -0
  31. data/ext/a4r_API_PALETTE.c +63 -0
  32. data/ext/a4r_API_RGB.c +118 -0
  33. data/ext/a4r_API_TIMER_DRIVER.c +14 -0
  34. data/ext/a4r_API_bitmap_objects.c +310 -0
  35. data/ext/a4r_API_blitting_and_sprites.c +86 -0
  36. data/ext/a4r_API_digital_sample_routines.c +83 -0
  37. data/ext/a4r_API_direct_access_to_video_memory.c +102 -0
  38. data/ext/a4r_API_drawing_primitives.c +114 -0
  39. data/ext/a4r_API_file_and_compression_routines.c +27 -0
  40. data/ext/a4r_API_fixed_point_math_routines.c +98 -0
  41. data/ext/a4r_API_fonts.c +147 -0
  42. data/ext/a4r_API_graphics_modes.c +155 -0
  43. data/ext/a4r_API_joystick_routines.c +213 -0
  44. data/ext/a4r_API_keyboard_routines.c +420 -0
  45. data/ext/a4r_API_misc.c +133 -0
  46. data/ext/a4r_API_mouse_routines.c +220 -0
  47. data/ext/a4r_API_music_routines_midi.c +147 -0
  48. data/ext/a4r_API_palette_routines.c +112 -0
  49. data/ext/a4r_API_sound_init_routines.c +29 -0
  50. data/ext/a4r_API_text_output.c +178 -0
  51. data/ext/a4r_API_timer_routines.c +250 -0
  52. data/ext/a4r_API_transparency_and_patterned_drawing.c +87 -0
  53. data/ext/a4r_API_truecolor_pixel_formats.c +44 -0
  54. data/ext/a4r_API_unicode_routines.c +53 -0
  55. data/ext/a4r_API_using_allegro.c +98 -0
  56. data/ext/allegro4r.c +866 -0
  57. data/ext/allegro4r.h +311 -0
  58. data/ext/extconf.rb +11 -0
  59. metadata +112 -0
@@ -0,0 +1,87 @@
1
+ #include "allegro4r.h"
2
+
3
+ /*
4
+ * call-seq:
5
+ * drawing_mode(mode, pattern, x_anchor, y_anchor) -> nil
6
+ *
7
+ * Sets the graphics drawing mode. This only affects the geometric routines like
8
+ * putpixel, lines, rectangles, circles, polygons, floodfill, etc, not the text
9
+ * output, blitting, or sprite drawing functions. The mode should be one of the
10
+ * following constants:
11
+ * DRAW_MODE_SOLID - the default, solid color drawing
12
+ * DRAW_MODE_XOR - exclusive-or drawing
13
+ * DRAW_MODE_COPY_PATTERN - multicolored pattern fill
14
+ * DRAW_MODE_SOLID_PATTERN - single color pattern fill
15
+ * DRAW_MODE_MASKED_PATTERN - masked pattern fill
16
+ * DRAW_MODE_TRANS - translucent color blending
17
+ *
18
+ * In DRAW_MODE_SOLID, pixels of the bitmap being drawn onto are simply replaced
19
+ * by those produced by the drawing function.
20
+ *
21
+ * In DRAW_MODE_XOR, pixels are written to the bitmap with an exclusive-or
22
+ * operation rather than a simple copy, so drawing the same shape twice will
23
+ * erase it. Because it involves reading as well as writing the bitmap memory,
24
+ * xor drawing is a lot slower than the normal replace mode.
25
+ *
26
+ * With the patterned modes, you provide a pattern bitmap which is tiled across
27
+ * the surface of the shape. Allegro stores a pointer to this bitmap rather than
28
+ * copying it, so you must not destroy the bitmap while it is still selected as
29
+ * the pattern. The width and height of the pattern must be powers of two, but
30
+ * they can be different, eg. a 64x16 pattern is fine, but a 17x3 one is not.
31
+ * The pattern is tiled in a grid starting at point (x_anchor, y_anchor).
32
+ * Normally you should just pass zero for these values, which lets you draw
33
+ * several adjacent shapes and have the patterns meet up exactly along the
34
+ * shared edges. Zero alignment may look peculiar if you are moving a patterned
35
+ * shape around the screen, however, because the shape will move but the pattern
36
+ * alignment will not, so in some situations you may wish to alter the anchor
37
+ * position.
38
+ *
39
+ * When you select DRAW_MODE_COPY_PATTERN, pixels are simply copied from the
40
+ * pattern bitmap onto the destination bitmap. This allows the use of
41
+ * multicolored patterns, and means that the color you pass to the drawing
42
+ * routine is ignored. This is the fastest of the patterned modes.
43
+ *
44
+ * In DRAW_MODE_SOLID_PATTERN, each pixel in the pattern bitmap is compared with
45
+ * the mask color, which is zero in 256-color modes or bright pink for truecolor
46
+ * data (maximum red and blue, zero green). If the pattern pixel is solid, a
47
+ * pixel of the color you passed to the drawing routine is written to the
48
+ * destination bitmap, otherwise a zero is written. The pattern is thus treated
49
+ * as a monochrome bitmask, which lets you use the same pattern to draw
50
+ * different shapes in different colors, but prevents the use of multicolored
51
+ * patterns.
52
+ *
53
+ * DRAW_MODE_MASKED_PATTERN is almost the same as DRAW_MODE_SOLID_PATTERN, but
54
+ * the masked pixels are skipped rather than being written as zeros, so the
55
+ * background shows through the gaps.
56
+ *
57
+ * In DRAW_MODE_TRANS, the global color_map table or truecolor blender functions
58
+ * are used to overlay pixels on top of the existing image. This must only be
59
+ * used after you have set up the color mapping table (for 256 color modes) or
60
+ * blender functions (for truecolor modes). Because it involves reading as well
61
+ * as writing the bitmap memory, translucent drawing is very slow if you draw
62
+ * directly to video RAM, so wherever possible you should use a memory bitmap
63
+ * instead.
64
+ */
65
+ VALUE a4r_API_drawing_mode(VALUE self, VALUE mode, VALUE pattern, VALUE x_anchor, VALUE y_anchor)
66
+ {
67
+ BITMAP *bitmap;
68
+ if (pattern == Qnil)
69
+ bitmap = NULL;
70
+ else
71
+ Data_Get_Struct(pattern, BITMAP, bitmap);
72
+ drawing_mode(FIX2INT(mode), bitmap, FIX2INT(x_anchor), FIX2INT(y_anchor));
73
+ return Qnil;
74
+ }
75
+
76
+ /*
77
+ * call-seq:
78
+ * solid_mode -> nil
79
+ *
80
+ * This is a shortcut for selecting solid drawing mode. It is equivalent to
81
+ * calling drawing_mode(DRAW_MODE_SOLID, nil, 0, 0).
82
+ */
83
+ VALUE a4r_API_solid_mode(VALUE self)
84
+ {
85
+ solid_mode();
86
+ return Qnil;
87
+ }
@@ -0,0 +1,44 @@
1
+ #include "allegro4r.h"
2
+
3
+ /*
4
+ * call-seq:
5
+ * make_col(r, g, b) -> a_rgb
6
+ *
7
+ * Converts colors from a hardware independent format (red, green, and blue
8
+ * values ranging 0-255) to the pixel format required by the current video mode,
9
+ * calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as
10
+ * appropriate. Example:
11
+ * # Regardless of color depth, this will look green.
12
+ * green_color = makecol(0, 255, 0)
13
+ *
14
+ * Return value: Returns the requested RGB triplet in the current color depth.
15
+ */
16
+ VALUE a4r_API_makecol(VALUE self, VALUE r, VALUE g, VALUE b)
17
+ {
18
+ return INT2FIX(makecol(FIX2INT(r), FIX2INT(g), FIX2INT(b)));
19
+ }
20
+
21
+ /*
22
+ * call-seq:
23
+ * palette_color -> ary
24
+ *
25
+ * Table mapping palette index colors (0-255) into whatever pixel format is
26
+ * being used by the current display mode. In a 256-color mode this just maps
27
+ * onto the array index. In truecolor modes it looks up the specified entry in
28
+ * the current palette, and converts that RGB value into the appropriate packed
29
+ * pixel format. Example:
30
+ * set_color_depth(32)
31
+ * ...
32
+ * set_palette(desktop_palette)
33
+ * # Put a pixel with the color 2 (green) of the palette
34
+ * putpixel(screen, 100, 100, palette_color[2])
35
+ */
36
+ VALUE a4r_API_palette_color(VALUE self)
37
+ {
38
+ // TODO: Cache the array, and only update if changed, or use hooked variable?
39
+ VALUE ary = rb_ary_new2(PAL_SIZE);
40
+ int x;
41
+ for (x = 0; x < PAL_SIZE; x++)
42
+ rb_ary_store(ary, x, INT2FIX(pallete_color[x]));
43
+ return ary;
44
+ }
@@ -0,0 +1,53 @@
1
+ #include "allegro4r.h"
2
+
3
+ /*
4
+ * call-seq:
5
+ * ustrzncpy(src, n) -> str
6
+ *
7
+ * This function is like ustrzcpy except that no more than 'n' characters from
8
+ * 'src' are copied into 'dest'. If 'src' is shorter than 'n' characters, null
9
+ * characters are appended to 'dest' as padding until 'n' characters have been
10
+ * written. In any case, 'dest' is guaranteed to be null-terminated.
11
+ *
12
+ * Note that, even for empty strings, your destination string must have at least
13
+ * enough bytes to store the terminating null character of the string, and your
14
+ * parameter 'size' must reflect this. Otherwise, the debug version of Allegro
15
+ * will abort at an assertion, and the release version of Allegro will overrun
16
+ * the destination buffer.
17
+ *
18
+ * Return value: The return value is the value of 'dest'.
19
+ *
20
+ * *** The Ruby method signature differs from the Allegro method signature. The
21
+ * Allegro signature takes a dest by reference, and a size, but the Ruby
22
+ * signature returns a string containing the dest. The returned string will
23
+ * have null characters appended as per the description above.
24
+ */
25
+ VALUE a4r_API_ustrzncpy(VALUE self, VALUE src, VALUE n)
26
+ {
27
+ int size = FIX2INT(n) + 1;
28
+ char *dest = ALLOC_N(char, size);
29
+ ustrzncpy(dest, size, StringValuePtr(src), size);
30
+ VALUE s = rb_str_new(dest, size - 1);
31
+ free(dest);
32
+ return s;
33
+ }
34
+
35
+ /*
36
+ * call-seq:
37
+ * usprintf(format) -> str
38
+ *
39
+ * This function writes formatted data into the output buffer. A NULL character
40
+ * is written to mark the end of the string. You should try to avoid this
41
+ * function because it is very easy to overflow the destination buffer. Use
42
+ * uszprintf instead.
43
+ *
44
+ * Return value: Returns the number of characters written, not including the
45
+ * terminating null character.
46
+ *
47
+ * *** The Ruby method differs from the Allegro method. The Allegro signature
48
+ * takes a dest but the Ruby signature returns a string containing the dest.
49
+ */
50
+ VALUE a4r_API_usprintf(VALUE self, VALUE format)
51
+ {
52
+ return format;
53
+ }
@@ -0,0 +1,98 @@
1
+ #include "allegro4r.h"
2
+
3
+ static VALUE a4r_at_exit()
4
+ {
5
+ rb_funcall(rb_mKernel, rb_intern("at_exit"), 0);
6
+ }
7
+
8
+ /*
9
+ * call-seq:
10
+ * allegro_init -> int
11
+ *
12
+ * Macro which initialises the Allegro library. This is the same thing as
13
+ * calling install_allegro(SYSTEM_AUTODETECT, &errno, atexit).
14
+ */
15
+ VALUE a4r_API_allegro_init(VALUE self)
16
+ {
17
+ int ret = allegro_init();
18
+ if (!ret)
19
+ rb_iterate(a4r_at_exit, 0, a4r_API_allegro_exit, self);
20
+ return INT2FIX(ret);
21
+ }
22
+
23
+ /*
24
+ * call-seq:
25
+ * allegro_exit -> nil
26
+ *
27
+ * Closes down the Allegro system. This includes returning the system to text
28
+ * mode and removing whatever mouse, keyboard, and timer routines have been
29
+ * installed. You don't normally need to bother making an explicit call to this
30
+ * function, because allegro_init installs it as an atexit routine so it will be
31
+ * called automatically when your program exits.
32
+ *
33
+ * Note that after you call this function, other functions like destroy_bitmap
34
+ * will most likely crash. This is a problem for C++ global destructors, which
35
+ * usually get called after atexit, so don't put Allegro calls in them. You can
36
+ * write the destructor code in another method which you can manually call
37
+ * before your program exits, avoiding this problem.
38
+ */
39
+ VALUE a4r_API_allegro_exit(VALUE self)
40
+ {
41
+ allegro_exit();
42
+ return Qnil;
43
+ }
44
+
45
+ /*
46
+ * call-seq:
47
+ * allegro_error -> str
48
+ *
49
+ * Text string used by set_gfx_mode, install_sound and other functions to report
50
+ * error messages. If they fail and you want to tell the user why, this is the
51
+ * place to look for a description of the problem. Example:
52
+ * def abort_on_error(message)
53
+ * set_gfx_mode(GFX_TEXT, 0, 0, 0, 0) unless screen.nil?
54
+ *
55
+ * allegro_message("%s.\nLast Allegro error '%s'\n" %
56
+ * [message, allegro_error])
57
+ * exit -1
58
+ * end
59
+ * ...
60
+ * if some_allegro_function == ERROR_CODE
61
+ * abort_on_error("Error calling some function!")
62
+ * end
63
+ */
64
+ VALUE a4r_API_allegro_error(VALUE self)
65
+ {
66
+ // TODO: Convert to data struct or cached or hooked variable?
67
+ return rb_str_new2(allegro_error);
68
+ }
69
+
70
+ /*
71
+ * call-seq:
72
+ * allegro_message(text) -> nil
73
+ *
74
+ * Outputs a message, using a printf format string. Usually you want to use this
75
+ * to report messages to the user in an OS independant way when some Allegro
76
+ * subsystem cannot be initialised. But you must not use this function if you
77
+ * are in a graphic mode, only before calling set_gfx_mode, or after a
78
+ * set_gfx_mode(GFX_TEXT). Also, this function depends on a system driver being
79
+ * installed, which means that it won't display the message at all on some
80
+ * platforms if Allegro has not been initialised correctly.
81
+ *
82
+ * On platforms featuring a windowing system, it will bring up a blocking GUI
83
+ * message box. If there is no windowing system, it will try to print the string
84
+ * to a text console, attempting to work around codepage differences by reducing
85
+ * any accented characters to 7-bit ASCII approximations. Example:
86
+ * exit 1 if allegro_init != 0
87
+ *
88
+ * if init_my_data != 0
89
+ * allegro_message("Sorry, missing game data!\n")
90
+ * exit 2
91
+ * end
92
+ */
93
+ VALUE a4r_API_allegro_message(VALUE self, VALUE text)
94
+ {
95
+ // TODO: Allow parameter possing a lo printf for direct API consistency or force string only?
96
+ allegro_message(StringValuePtr(text));
97
+ return Qnil;
98
+ }
@@ -0,0 +1,866 @@
1
+ /* ______ ___ ___ __ __
2
+ * /\ _ \ /\_ \ /\_ \ /\ \\ \
3
+ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___\ \ \\ \ _ __
4
+ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ \ \\ \_ /\`'__\
5
+ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ \__ ,__\ \ \/
6
+ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/\/_/\_\_/\ \_\
7
+ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ \/_/ \/_/
8
+ * /\____/
9
+ * \_/__/
10
+ *
11
+ * Main file for the Allegro4r Ruby binding to the Allegro library.
12
+ *
13
+ * By Jason Frey.
14
+ */
15
+
16
+ #include "allegro4r.h"
17
+
18
+ /*
19
+ * Document-class: Allegro4r
20
+ *
21
+ * The Allegro4r module.
22
+ */
23
+ VALUE mAllegro4r;
24
+
25
+ /*
26
+ * Document-class: Allegro4r::API
27
+ *
28
+ * The Allegro4r::API module.
29
+ */
30
+ VALUE mAllegro4r_API;
31
+
32
+ /*
33
+ * Document-class: Allegro4r::API::BITMAP
34
+ *
35
+ * Stores the contents of a bitmap.
36
+ *
37
+ * int w, h - size of the bitmap in pixels
38
+ * int clip - non-zero if clipping is turned on
39
+ * int cl, cr, ct, cb - clip rectangle left, right, top,
40
+ * and bottom
41
+ * unsigned char *line[] - pointers to the start of each line
42
+ *
43
+ * There is some other stuff in the structure as well, but it is liable to
44
+ * change and you shouldn't use anything except the above. The 'w' and 'h'
45
+ * fields can be used to obtain the size of an existing bitmap:
46
+ *
47
+ * bmp = load_bitmap("file.bmp", pal)
48
+ * allegro_message("Bitmap size: (%dx%d)\n" % [bmp.w, bmp.h])
49
+ *
50
+ * The clipping rectangle is inclusive on the left and top (0 allows drawing to
51
+ * position 0) but exclusive on the right and bottom (10 allows drawing to
52
+ * position 9, but not to 10). Note this is not the same format as that of the
53
+ * clipping API, which takes inclusive coordinates for all four corners. All the
54
+ * values of this structure should be regarded as read-only, with the exception
55
+ * of the line field, whose access is described in depth in the "Direct access
56
+ * to video memory" section of the manual. If you want to modify the clipping
57
+ * region, please refrain from changing this structure. Use set_clip_rect
58
+ * instead.
59
+ */
60
+ VALUE cAPI_BITMAP;
61
+
62
+ /*
63
+ * Document-class: Allegro4r::API::JOYSTICK_INFO
64
+ *
65
+ * Stores the contents of joystick information.
66
+ *
67
+ * Read chapter "Joystick routines" for a description on how to obtain/use this
68
+ * structure.
69
+ */
70
+ VALUE cAPI_JOYSTICK_INFO;
71
+
72
+ /*
73
+ * Document-class: Allegro4r::API::JOYSTICK_BUTTON_INFO
74
+ *
75
+ * Stores the contents of joystick button information.
76
+ *
77
+ * Read chapter "Joystick routines" for a description on how to obtain/use this
78
+ * structure.
79
+ */
80
+ VALUE cAPI_JOYSTICK_BUTTON_INFO;
81
+
82
+ /*
83
+ * Document-class: Allegro4r::API::JOYSTICK_STICK_INFO
84
+ *
85
+ * Stores the contents of joystick stick information.
86
+ *
87
+ * Read chapter "Joystick routines" for a description on how to obtain/use this
88
+ * structure.
89
+ */
90
+ VALUE cAPI_JOYSTICK_STICK_INFO;
91
+
92
+ /*
93
+ * Document-class: Allegro4r::API::JOYSTICK_AXIS_INFO
94
+ *
95
+ * Stores the contents of joystick axis information.
96
+ *
97
+ * Read chapter "Joystick routines" for a description on how to obtain/use this
98
+ * structure.
99
+ */
100
+ VALUE cAPI_JOYSTICK_AXIS_INFO;
101
+
102
+ /*
103
+ * Document-class: Allegro4r::API::PALETTE
104
+ *
105
+ * Allegro palettes are arrays of PAL_SIZE RGB entries.
106
+ */
107
+ VALUE cAPI_PALETTE;
108
+
109
+ /*
110
+ * Document-class: Allegro4r::API::RGB
111
+ * unsigned char r, g, b
112
+ *
113
+ * Palette entry. It contains an additional field for the purpose of padding but
114
+ * you should not usually care about it. Read chapter "Palette routines" for a
115
+ * description on how to obtain/use this structure.
116
+ */
117
+ VALUE cAPI_RGB;
118
+
119
+ /*
120
+ * Document-class: Allegro4r::API::FONT
121
+ *
122
+ * The Allegro4r::API::FONT class.
123
+ */
124
+ VALUE cAPI_FONT;
125
+
126
+ /*
127
+ * Document-class: Allegro4r::API::SAMPLE
128
+ *
129
+ * int bits; - 8 or 16
130
+ * int stereo; - sample type flag
131
+ * int freq; - sample frequency
132
+ * int priority; - 0-255
133
+ * unsigned long len; - length (in samples)
134
+ * unsigned long loop_start; - loop start position
135
+ * unsigned long loop_end; - loop finish position
136
+ * void *data; - raw sample data
137
+ *
138
+ * A sample structure, which holds sound data, used by the digital sample
139
+ * routines. You can consider all of these fields as read only except priority,
140
+ * loop_start and loop_end, which you can change them for example after loading
141
+ * a sample from disk.
142
+ *
143
+ * The priority is a value from 0 to 255 (by default set to 128) and controls
144
+ * how hardware voices on the sound card are allocated if you attempt to play
145
+ * more than the driver can handle. This may be used to ensure that the less
146
+ * important sounds are cut off while the important ones are preserved.
147
+ *
148
+ * The variables loop_start and loop_end specify the loop position in sample
149
+ * units, and are set by default to the start and end of the sample.
150
+ *
151
+ * If you are creating your own samples on the fly, you might also want to
152
+ * modify the raw data of the sample pointed by the data field. The sample data
153
+ * are always in unsigned format. This means that if you are loading a PCM
154
+ * encoded sound file with signed 16-bit samples, you would have to XOR every
155
+ * two bytes (i.e. every sample value) with 0x8000 to change the signedness.
156
+ */
157
+ VALUE cAPI_SAMPLE;
158
+
159
+ /*
160
+ * Document-class: Allegro4r::API::MIDI
161
+ *
162
+ * A structure holding MIDI data. Read chapter "Music routines (MIDI)" for a
163
+ * description on how to obtain/use this structure.
164
+ */
165
+ VALUE cAPI_MIDI;
166
+
167
+ /*
168
+ * Document-class: Allegro4r::API::GFX_DRIVER
169
+ *
170
+ * Creates and manages the screen bitmap.
171
+ */
172
+ VALUE cAPI_GFX_DRIVER;
173
+
174
+ /*
175
+ * Document-class: Allegro4r::API::TIMER_DRIVER
176
+ *
177
+ * Stores the contents of the timer driver.
178
+ */
179
+ VALUE cAPI_TIMER_DRIVER;
180
+
181
+ /*
182
+ * Document-class: Allegro4r::API::MOUSE_DRIVER
183
+ *
184
+ * Stores the contents of the mouse driver.
185
+ */
186
+ VALUE cAPI_MOUSE_DRIVER;
187
+
188
+ /*
189
+ * Document-class: Allegro4r::API::KEYBOARD_DRIVER
190
+ *
191
+ * Stores the contents of the keyboard driver.
192
+ */
193
+ VALUE cAPI_KEYBOARD_DRIVER;
194
+
195
+ /*
196
+ * Document-class: Allegro4r::API::JOYSTICK_DRIVER
197
+ *
198
+ * Driver for reading joystick input.
199
+ */
200
+ VALUE cAPI_JOYSTICK_DRIVER;
201
+
202
+ /*
203
+ * Document-class: Allegro4r::API::DIGI_DRIVER
204
+ *
205
+ * Driver for playing digital sfx.
206
+ */
207
+ VALUE cAPI_DIGI_DRIVER;
208
+
209
+ /*
210
+ * Document-class: Allegro4r::API::MIDI_DRIVER
211
+ *
212
+ * Driver for playing midi music.
213
+ */
214
+ VALUE cAPI_MIDI_DRIVER;
215
+
216
+ ID CALL_ID;
217
+
218
+ void Init_allegro4r()
219
+ {
220
+ CALL_ID = rb_intern("call");
221
+
222
+ mAllegro4r = rb_define_module("Allegro4r");
223
+ mAllegro4r_API = rb_define_module_under(mAllegro4r, "API");
224
+
225
+ cAPI_BITMAP = rb_define_class_under(mAllegro4r_API, "BITMAP", rb_cObject); // in a4r_API_BITMAP.c
226
+ rb_define_method(cAPI_BITMAP, "h", a4r_API_BITMAP_h_get, 0); // in a4r_API_BITMAP.c
227
+ rb_define_method(cAPI_BITMAP, "w", a4r_API_BITMAP_w_get, 0); // in a4r_API_BITMAP.c
228
+
229
+ cAPI_JOYSTICK_INFO = rb_define_class_under(mAllegro4r_API, "JOYSTICK_INFO", rb_cObject); // in a4r_API_JOYSTICK_INFO.c
230
+ rb_define_method(cAPI_JOYSTICK_INFO, "flags", a4r_API_JOYSTICK_INFO_flags, 0); // in a4r_API_JOYSTICK_INFO.c
231
+ rb_define_method(cAPI_JOYSTICK_INFO, "num_sticks", a4r_API_JOYSTICK_INFO_num_sticks, 0); // in a4r_API_JOYSTICK_INFO.c
232
+ rb_define_method(cAPI_JOYSTICK_INFO, "num_buttons", a4r_API_JOYSTICK_INFO_num_buttons, 0); // in a4r_API_JOYSTICK_INFO.c
233
+ rb_define_method(cAPI_JOYSTICK_INFO, "stick", a4r_API_JOYSTICK_INFO_stick, 0); // in a4r_API_JOYSTICK_INFO.c
234
+ rb_define_method(cAPI_JOYSTICK_INFO, "button", a4r_API_JOYSTICK_INFO_button, 0); // in a4r_API_JOYSTICK_INFO.c
235
+
236
+ cAPI_JOYSTICK_BUTTON_INFO = rb_define_class_under(mAllegro4r_API, "JOYSTICK_BUTTON_INFO", rb_cObject); // in a4r_API_JOYSTICK_BUTTON_INFO.c
237
+ rb_define_method(cAPI_JOYSTICK_BUTTON_INFO, "b", a4r_API_JOYSTICK_BUTTON_INFO_b, 0); // in a4r_API_JOYSTICK_BUTTON_INFO.c
238
+ rb_define_method(cAPI_JOYSTICK_BUTTON_INFO, "name", a4r_API_JOYSTICK_BUTTON_INFO_name, 0); // in a4r_API_JOYSTICK_BUTTON_INFO.c
239
+
240
+ cAPI_JOYSTICK_STICK_INFO = rb_define_class_under(mAllegro4r_API, "JOYSTICK_STICK_INFO", rb_cObject); // in a4r_API_JOYSTICK_STICK_INFO.c
241
+ rb_define_method(cAPI_JOYSTICK_STICK_INFO, "flags", a4r_API_JOYSTICK_STICK_INFO_flags, 0); // in a4r_API_JOYSTICK_STICK_INFO.c
242
+ rb_define_method(cAPI_JOYSTICK_STICK_INFO, "num_axis", a4r_API_JOYSTICK_STICK_INFO_num_axis, 0); // in a4r_API_JOYSTICK_STICK_INFO.c
243
+ rb_define_method(cAPI_JOYSTICK_STICK_INFO, "axis", a4r_API_JOYSTICK_STICK_INFO_axis, 0); // in a4r_API_JOYSTICK_STICK_INFO.c
244
+ rb_define_method(cAPI_JOYSTICK_STICK_INFO, "name", a4r_API_JOYSTICK_STICK_INFO_name, 0); // in a4r_API_JOYSTICK_STICK_INFO.c
245
+
246
+ cAPI_JOYSTICK_AXIS_INFO = rb_define_class_under(mAllegro4r_API, "JOYSTICK_AXIS_INFO", rb_cObject); // in a4r_API_JOYSTICK_AXIS_INFO.c
247
+ rb_define_method(cAPI_JOYSTICK_AXIS_INFO, "pos", a4r_API_JOYSTICK_AXIS_INFO_pos, 0); // in a4r_API_JOYSTICK_AXIS_INFO.c
248
+ rb_define_method(cAPI_JOYSTICK_AXIS_INFO, "d1", a4r_API_JOYSTICK_AXIS_INFO_d1, 0); // in a4r_API_JOYSTICK_AXIS_INFO.c
249
+ rb_define_method(cAPI_JOYSTICK_AXIS_INFO, "d2", a4r_API_JOYSTICK_AXIS_INFO_d2, 0); // in a4r_API_JOYSTICK_AXIS_INFO.c
250
+ rb_define_method(cAPI_JOYSTICK_AXIS_INFO, "name", a4r_API_JOYSTICK_AXIS_INFO_name, 0); // in a4r_API_JOYSTICK_AXIS_INFO.c
251
+
252
+ cAPI_PALETTE = rb_define_class_under(mAllegro4r_API, "PALETTE", rb_cObject); // in a4r_API_PALETTE.c
253
+ rb_define_alloc_func(cAPI_PALETTE, a4r_API_PALETTE_alloc); // in a4r_API_PALETTE.c
254
+ rb_define_method(cAPI_PALETTE, "initialize_copy", a4r_API_PALETTE_initialize_copy, 1); // in a4r_API_PALETTE.c
255
+ rb_define_method(cAPI_PALETTE, "[]", a4r_API_PALETTE_getter, 1); // in a4r_API_PALETTE.c
256
+ rb_define_method(cAPI_PALETTE, "[]=", a4r_API_PALETTE_setter, 2); // in a4r_API_PALETTE.c
257
+
258
+ cAPI_RGB = rb_define_class_under(mAllegro4r_API, "RGB", rb_cObject); // in a4r_API_RGB.c
259
+ rb_define_alloc_func(cAPI_RGB, a4r_API_RGB_alloc); // in a4r_API_RGB.c
260
+ rb_define_method(cAPI_RGB, "initialize_copy", a4r_API_RGB_initialize_copy, 1); // in a4r_API_RGB.c
261
+ rb_define_method(cAPI_RGB, "r", a4r_API_RGB_r_get, 0); // in a4r_API_RGB.c
262
+ rb_define_method(cAPI_RGB, "r=", a4r_API_RGB_r_set, 1); // in a4r_API_RGB.c
263
+ rb_define_method(cAPI_RGB, "g", a4r_API_RGB_g_get, 0); // in a4r_API_RGB.c
264
+ rb_define_method(cAPI_RGB, "g=", a4r_API_RGB_g_set, 1); // in a4r_API_RGB.c
265
+ rb_define_method(cAPI_RGB, "b", a4r_API_RGB_b_get, 0); // in a4r_API_RGB.c
266
+ rb_define_method(cAPI_RGB, "b=", a4r_API_RGB_b_set, 1); // in a4r_API_RGB.c
267
+
268
+ cAPI_FONT = rb_define_class_under(mAllegro4r_API, "FONT", rb_cObject);
269
+
270
+ cAPI_SAMPLE = rb_define_class_under(mAllegro4r_API, "SAMPLE", rb_cObject);
271
+
272
+ cAPI_MIDI = rb_define_class_under(mAllegro4r_API, "MIDI", rb_cObject);
273
+
274
+ cAPI_GFX_DRIVER = rb_define_class_under(mAllegro4r_API, "GFX_DRIVER", rb_cObject); // in a4r_API_GFX_DRIVER.c
275
+ rb_define_method(cAPI_GFX_DRIVER, "name", a4r_API_GFX_DRIVER_name_get, 0); // in a4r_API_GFX_DRIVER.c
276
+
277
+ cAPI_MOUSE_DRIVER = rb_define_class_under(mAllegro4r_API, "MOUSE_DRIVER", rb_cObject); // in a4r_API_MOUSE_DRIVER.c
278
+ rb_define_method(cAPI_MOUSE_DRIVER, "name", a4r_API_MOUSE_DRIVER_name_get, 0); // in a4r_API_MOUSE_DRIVER.c
279
+
280
+ cAPI_TIMER_DRIVER = rb_define_class_under(mAllegro4r_API, "TIMER_DRIVER", rb_cObject); // in a4r_API_TIMER_DRIVER.c
281
+ rb_define_method(cAPI_TIMER_DRIVER, "name", a4r_API_TIMER_DRIVER_name_get, 0); // in a4r_API_TIMER_DRIVER.c
282
+
283
+ cAPI_KEYBOARD_DRIVER = rb_define_class_under(mAllegro4r_API, "KEYBOARD_DRIVER", rb_cObject); // in a4r_API_KEYBOARD_DRIVER.c
284
+ rb_define_method(cAPI_KEYBOARD_DRIVER, "name", a4r_API_KEYBOARD_DRIVER_name_get, 0); // in a4r_API_KEYBOARD_DRIVER.c
285
+
286
+ cAPI_JOYSTICK_DRIVER = rb_define_class_under(mAllegro4r_API, "JOYSTICK_DRIVER", rb_cObject); // in a4r_API_JOYSTICK_DRIVER.c
287
+ rb_define_method(cAPI_JOYSTICK_DRIVER, "name", a4r_API_JOYSTICK_DRIVER_name_get, 0); // in a4r_API_JOYSTICK_DRIVER.c
288
+
289
+ cAPI_DIGI_DRIVER = rb_define_class_under(mAllegro4r_API, "DIGI_DRIVER", rb_cObject); // in a4r_API_DIGI_DRIVER.c
290
+ rb_define_method(cAPI_DIGI_DRIVER, "name", a4r_API_DIGI_DRIVER_name_get, 0); // in a4r_API_DIGI_DRIVER.c
291
+
292
+ cAPI_MIDI_DRIVER = rb_define_class_under(mAllegro4r_API, "MIDI_DRIVER", rb_cObject); // in a4r_API_MIDI_DRIVER.c
293
+ rb_define_method(cAPI_MIDI_DRIVER, "name", a4r_API_MIDI_DRIVER_name_get, 0); // in a4r_API_MIDI_DRIVER.c
294
+
295
+ rb_define_module_function(mAllegro4r_API, "MIN", a4r_API_MIN, 2); // in a4r_API_misc.c
296
+ rb_define_module_function(mAllegro4r_API, "ABS", a4r_API_ABS, 1); // in a4r_API_misc.c
297
+ rb_define_module_function(mAllegro4r_API, "AL_RAND", a4r_API_AL_RAND, 0); // in a4r_API_misc.c
298
+ rb_define_module_function(mAllegro4r_API, "gfx_driver", a4r_API_gfx_driver, 0); // in a4r_API_misc.c
299
+ rb_define_module_function(mAllegro4r_API, "mouse_driver", a4r_API_mouse_driver, 0); // in a4r_API_misc.c
300
+ rb_define_module_function(mAllegro4r_API, "timer_driver", a4r_API_timer_driver, 0); // in a4r_API_misc.c
301
+ rb_define_module_function(mAllegro4r_API, "keyboard_driver", a4r_API_keyboard_driver, 0); // in a4r_API_misc.c
302
+ rb_define_module_function(mAllegro4r_API, "joystick_driver", a4r_API_joystick_driver, 0); // in a4r_API_misc.c
303
+ rb_define_module_function(mAllegro4r_API, "digi_driver", a4r_API_digi_driver, 0); // in a4r_API_misc.c
304
+ rb_define_module_function(mAllegro4r_API, "midi_driver", a4r_API_midi_driver, 0); // in a4r_API_misc.c
305
+
306
+ rb_define_module_function(mAllegro4r_API, "allegro_init", a4r_API_allegro_init, 0); // in a4r_API_using_allegro.c
307
+ rb_define_module_function(mAllegro4r_API, "allegro_exit", a4r_API_allegro_exit, 0); // in a4r_API_using_allegro.c
308
+ rb_define_module_function(mAllegro4r_API, "allegro_error", a4r_API_allegro_error, 0); // in a4r_API_using_allegro.c
309
+ rb_define_module_function(mAllegro4r_API, "allegro_message", a4r_API_allegro_message, 1); // in a4r_API_using_allegro.c
310
+
311
+ rb_define_module_function(mAllegro4r_API, "ustrzncpy", a4r_API_ustrzncpy, 2); // in a4r_API_unicode_routines.c
312
+ rb_define_module_function(mAllegro4r_API, "usprintf", a4r_API_usprintf, 1); // in a4r_API_unicode_routines.c
313
+
314
+ rb_define_module_function(mAllegro4r_API, "install_mouse", a4r_API_install_mouse, 0); // in a4r_API_mouse_routines.c
315
+ rb_define_module_function(mAllegro4r_API, "poll_mouse", a4r_API_poll_mouse, 0); // in a4r_API_mouse_routines.c
316
+ rb_define_module_function(mAllegro4r_API, "mouse_x", a4r_API_mouse_x, 0); // in a4r_API_mouse_routines.c
317
+ rb_define_module_function(mAllegro4r_API, "mouse_y", a4r_API_mouse_y, 0); // in a4r_API_mouse_routines.c
318
+ rb_define_module_function(mAllegro4r_API, "mouse_z", a4r_API_mouse_z, 0); // in a4r_API_mouse_routines.c
319
+ rb_define_module_function(mAllegro4r_API, "mouse_w", a4r_API_mouse_w, 0); // in a4r_API_mouse_routines.c
320
+ rb_define_module_function(mAllegro4r_API, "mouse_b", a4r_API_mouse_b, 0); // in a4r_API_mouse_routines.c
321
+ rb_define_module_function(mAllegro4r_API, "show_mouse", a4r_API_show_mouse, 1); // in a4r_API_mouse_routines.c
322
+ rb_define_module_function(mAllegro4r_API, "get_mouse_mickeys", a4r_API_get_mouse_mickeys, 0); // in a4r_API_mouse_routines.c
323
+ rb_define_module_function(mAllegro4r_API, "set_mouse_sprite", a4r_API_set_mouse_sprite, 1); // in a4r_API_mouse_routines.c
324
+ rb_define_module_function(mAllegro4r_API, "set_mouse_sprite_focus", a4r_API_set_mouse_sprite_focus, 2); // in a4r_API_mouse_routines.c
325
+
326
+ rb_define_module_function(mAllegro4r_API, "install_timer", a4r_API_install_timer, 0); // in a4r_API_timer_routines.c
327
+ rb_define_module_function(mAllegro4r_API, "install_int", a4r_API_install_int, 2); // in a4r_API_timer_routines.c
328
+ rb_define_module_function(mAllegro4r_API, "install_int_ex", a4r_API_install_int_ex, 2); // in a4r_API_timer_routines.c
329
+ rb_define_module_function(mAllegro4r_API, "LOCK_VARIABLE", a4r_API_LOCK_VARIABLE, 1); // in a4r_API_timer_routines.c
330
+ rb_define_module_function(mAllegro4r_API, "LOCK_FUNCTION", a4r_API_LOCK_FUNCTION, 1); // in a4r_API_timer_routines.c
331
+ rb_define_module_function(mAllegro4r_API, "retrace_count", a4r_API_retrace_count, 0); // in a4r_API_timer_routines.c
332
+ rb_define_module_function(mAllegro4r_API, "rest", a4r_API_rest, 1); // in a4r_API_timer_routines.c
333
+ rb_define_module_function(mAllegro4r_API, "SECS_TO_TIMER", a4r_API_SECS_TO_TIMER, 1); // in a4r_API_timer_routines.c
334
+ rb_define_module_function(mAllegro4r_API, "MSEC_TO_TIMER", a4r_API_MSEC_TO_TIMER, 1); // in a4r_API_timer_routines.c
335
+ rb_define_module_function(mAllegro4r_API, "BPS_TO_TIMER", a4r_API_BPS_TO_TIMER, 1); // in a4r_API_timer_routines.c
336
+ rb_define_module_function(mAllegro4r_API, "BPM_TO_TIMER", a4r_API_BPM_TO_TIMER, 1); // in a4r_API_timer_routines.c
337
+
338
+ timer_counter_names = rb_hash_new();
339
+ rb_global_variable(&timer_counter_names);
340
+ LOCK_VARIABLE(timer_counters)
341
+ LOCK_FUNCTION(timer_counter_incr)
342
+ rb_define_module_function(mAllegro4r_API, "timer_counter_get", a4r_API_timer_counter_get, 1); // in a4r_API_timer_routines.c
343
+
344
+ rb_define_module_function(mAllegro4r_API, "install_keyboard", a4r_API_install_keyboard, 0); // in a4r_API_keyboard_routines.c
345
+ rb_define_module_function(mAllegro4r_API, "poll_keyboard", a4r_API_poll_keyboard, 0); // in a4r_API_keyboard_routines.c
346
+ rb_define_module_function(mAllegro4r_API, "key", a4r_API_key, 0); // in a4r_API_keyboard_routines.c
347
+ rb_define_module_function(mAllegro4r_API, "key_shifts", a4r_API_key_shifts, 0); // in a4r_API_keyboard_routines.c
348
+ rb_define_module_function(mAllegro4r_API, "keypressed", a4r_API_keypressed, 0); // in a4r_API_keyboard_routines.c
349
+ rb_define_module_function(mAllegro4r_API, "readkey", a4r_API_readkey, 0); // in a4r_API_keyboard_routines.c
350
+ rb_define_module_function(mAllegro4r_API, "ureadkey", a4r_API_ureadkey, 1); // in a4r_API_keyboard_routines.c
351
+ rb_define_module_function(mAllegro4r_API, "scancode_to_name", a4r_API_scancode_to_name, 1); // in a4r_API_keyboard_routines.c
352
+ rb_define_module_function(mAllegro4r_API, "keyboard_callback=", a4r_API_keyboard_callback_set, 1); // in a4r_API_keyboard_routines.c
353
+ rb_define_module_function(mAllegro4r_API, "keyboard_lowlevel_callback=", a4r_API_keyboard_lowlevel_callback_set, 1); // in a4r_API_keyboard_routines.c
354
+ rb_define_module_function(mAllegro4r_API, "clear_keybuf", a4r_API_clear_keybuf, 0); // in a4r_API_keyboard_routines.c
355
+
356
+ rb_global_variable(&keyboard_callback_proc);
357
+ rb_global_variable(&keyboard_lowlevel_callback_proc);
358
+ LOCK_VARIABLE(keyboard_callback_proc)
359
+ LOCK_VARIABLE(keyboard_lowlevel_callback_proc)
360
+ LOCK_FUNCTION(keyboard_callback_method)
361
+ LOCK_FUNCTION(keyboard_lowlevel_callback_method)
362
+
363
+ rb_define_module_function(mAllegro4r_API, "install_joystick", a4r_API_install_joystick, 1); // in a4r_API_joystick_routines.c
364
+ rb_define_module_function(mAllegro4r_API, "poll_joystick", a4r_API_poll_joystick, 0); // in a4r_API_joystick_routines.c
365
+ rb_define_module_function(mAllegro4r_API, "num_joysticks", a4r_API_num_joysticks, 0); // in a4r_API_joystick_routines.c
366
+ rb_define_module_function(mAllegro4r_API, "joy", a4r_API_joy, 0); // in a4r_API_joystick_routines.c
367
+ rb_define_module_function(mAllegro4r_API, "calibrate_joystick_name", a4r_API_calibrate_joystick_name, 1); // in a4r_API_joystick_routines.c
368
+ rb_define_module_function(mAllegro4r_API, "calibrate_joystick", a4r_API_calibrate_joystick, 1); // in a4r_API_joystick_routines.c
369
+
370
+ rb_define_module_function(mAllegro4r_API, "set_gfx_mode", a4r_API_set_gfx_mode, 5); // in a4r_API_graphics_modes.c
371
+ rb_define_module_function(mAllegro4r_API, "set_display_switch_mode", a4r_API_set_display_switch_mode, 1); // in a4r_API_graphics_modes.c
372
+ rb_define_module_function(mAllegro4r_API, "show_video_bitmap", a4r_API_show_video_bitmap, 1); // in a4r_API_graphics_modes.c
373
+ rb_define_module_function(mAllegro4r_API, "vsync", a4r_API_vsync, 0); // in a4r_API_graphics_modes.c
374
+
375
+ rb_define_module_function(mAllegro4r_API, "screen", a4r_API_screen, 0); // in a4r_API_bitmap_objects.c
376
+ rb_define_module_function(mAllegro4r_API, "SCREEN_W", a4r_API_SCREEN_W, 0); // in a4r_API_bitmap_objects.c
377
+ rb_define_module_function(mAllegro4r_API, "SCREEN_H", a4r_API_SCREEN_H, 0); // in a4r_API_bitmap_objects.c
378
+ rb_define_module_function(mAllegro4r_API, "create_bitmap", a4r_API_create_bitmap, 2); // in a4r_API_bitmap_objects.c
379
+ rb_define_module_function(mAllegro4r_API, "create_sub_bitmap", a4r_API_create_sub_bitmap, 5); // in a4r_API_bitmap_objects.c
380
+ rb_define_module_function(mAllegro4r_API, "create_video_bitmap", a4r_API_create_video_bitmap, 2); // in a4r_API_bitmap_objects.c
381
+ rb_define_module_function(mAllegro4r_API, "destroy_bitmap", a4r_API_destroy_bitmap, 1); // in a4r_API_bitmap_objects.c
382
+ rb_define_module_function(mAllegro4r_API, "bitmap_mask_color", a4r_API_bitmap_mask_color, 1); // in a4r_API_bitmap_objects.c
383
+ rb_define_module_function(mAllegro4r_API, "acquire_bitmap", a4r_API_acquire_bitmap, 1); // in a4r_API_bitmap_objects.c
384
+ rb_define_module_function(mAllegro4r_API, "release_bitmap", a4r_API_release_bitmap, 1); // in a4r_API_bitmap_objects.c
385
+ rb_define_module_function(mAllegro4r_API, "acquire_screen", a4r_API_acquire_screen, 0); // in a4r_API_bitmap_objects.c
386
+ rb_define_module_function(mAllegro4r_API, "release_screen", a4r_API_release_screen, 0); // in a4r_API_bitmap_objects.c
387
+
388
+ rb_define_module_function(mAllegro4r_API, "set_palette", a4r_API_set_palette, 1); // in a4r_API_palette_routines.c
389
+ rb_define_module_function(mAllegro4r_API, "get_palette", a4r_API_get_palette, 1); // in a4r_API_palette_routines.c
390
+ rb_define_module_function(mAllegro4r_API, "default_palette", a4r_API_default_palette, 0); // in a4r_API_palette_routines.c
391
+ rb_define_module_function(mAllegro4r_API, "black_palette", a4r_API_black_palette, 0); // in a4r_API_palette_routines.c
392
+ rb_define_module_function(mAllegro4r_API, "desktop_palette", a4r_API_desktop_palette, 0); // in a4r_API_palette_routines.c
393
+
394
+ rb_define_module_function(mAllegro4r_API, "makecol", a4r_API_makecol, 3); // in a4r_API_truecolor_pixel_formats.c
395
+ rb_define_module_function(mAllegro4r_API, "palette_color", a4r_API_palette_color, 0); // in a4r_API_truecolor_pixel_formats.c
396
+
397
+ rb_define_module_function(mAllegro4r_API, "clear_bitmap", a4r_API_clear_bitmap, 1); // in a4r_API_drawing_primitives.c
398
+ rb_define_module_function(mAllegro4r_API, "clear_to_color", a4r_API_clear_to_color, 2); // in a4r_API_drawing_primitives.c
399
+ rb_define_module_function(mAllegro4r_API, "putpixel", a4r_API_putpixel, 4); // in a4r_API_drawing_primitives.c
400
+ rb_define_module_function(mAllegro4r_API, "getpixel", a4r_API_getpixel, 3); // in a4r_API_drawing_primitives.c
401
+ rb_define_module_function(mAllegro4r_API, "rectfill", a4r_API_rectfill, 6); // in a4r_API_drawing_primitives.c
402
+ rb_define_module_function(mAllegro4r_API, "circle", a4r_API_circle, 5); // in a4r_API_drawing_primitives.c
403
+ rb_define_module_function(mAllegro4r_API, "circlefill", a4r_API_circlefill, 5); // in a4r_API_drawing_primitives.c
404
+
405
+ rb_define_module_function(mAllegro4r_API, "blit", a4r_API_blit, 8); // in a4r_API_blitting_and_sprites.c
406
+ rb_define_module_function(mAllegro4r_API, "masked_blit", a4r_API_masked_blit, 8); // in a4r_API_blitting_and_sprites.c
407
+
408
+ rb_define_module_function(mAllegro4r_API, "load_font", a4r_API_load_font, 3); // in a4r_API_fonts.c
409
+ rb_define_module_function(mAllegro4r_API, "destroy_font", a4r_API_destroy_font, 1); // in a4r_API_fonts.c
410
+ rb_define_module_function(mAllegro4r_API, "extract_font_range", a4r_API_extract_font_range, 3); // in a4r_API_fonts.c
411
+ rb_define_module_function(mAllegro4r_API, "merge_fonts", a4r_API_merge_fonts, 2); // in a4r_API_fonts.c
412
+
413
+ rb_define_module_function(mAllegro4r_API, "font", a4r_API_font, 0); // in a4r_API_text_output.c
414
+ rb_define_module_function(mAllegro4r_API, "font=", a4r_API_font_set, 1); // in a4r_API_text_output.c
415
+ rb_define_module_function(mAllegro4r_API, "text_length", a4r_API_text_length, 2); // in a4r_API_text_output.c
416
+ rb_define_module_function(mAllegro4r_API, "text_height", a4r_API_text_height, 1); // in a4r_API_text_output.c
417
+ rb_define_module_function(mAllegro4r_API, "textout_ex", a4r_API_textout_ex, 7); // in a4r_API_text_output.c
418
+ rb_define_module_function(mAllegro4r_API, "textout_centre_ex", a4r_API_textout_centre_ex, 7); // in a4r_API_text_output.c
419
+ rb_define_module_function(mAllegro4r_API, "textprintf_ex", a4r_API_textprintf_ex, 7); // in a4r_API_text_output.c
420
+ rb_define_module_function(mAllegro4r_API, "textprintf_centre_ex", a4r_API_textprintf_centre_ex, 7); // in a4r_API_text_output.c
421
+ rb_define_module_function(mAllegro4r_API, "textprintf_right_ex", a4r_API_textprintf_right_ex, 7); // in a4r_API_text_output.c
422
+
423
+ rb_define_module_function(mAllegro4r_API, "drawing_mode", a4r_API_drawing_mode, 4); // in a4r_API_transparency_and_patterned_drawing.c
424
+ rb_define_module_function(mAllegro4r_API, "solid_mode", a4r_API_solid_mode, 0); // in a4r_API_transparency_and_patterned_drawing.c
425
+
426
+ rb_define_module_function(mAllegro4r_API, "bmp_select", a4r_API_bmp_select, 1); // in a4r_API_direct_access_to_video_memory.c
427
+ rb_define_module_function(mAllegro4r_API, "bmp_read8", a4r_API_bmp_read8, 1); // in a4r_API_direct_access_to_video_memory.c
428
+ rb_define_module_function(mAllegro4r_API, "bmp_read32", a4r_API_bmp_read32, 1); // in a4r_API_direct_access_to_video_memory.c
429
+ rb_define_module_function(mAllegro4r_API, "bmp_write8", a4r_API_bmp_write8, 2); // in a4r_API_direct_access_to_video_memory.c
430
+ rb_define_module_function(mAllegro4r_API, "bmp_write32", a4r_API_bmp_write32, 2); // in a4r_API_direct_access_to_video_memory.c
431
+ rb_define_module_function(mAllegro4r_API, "bmp_write_line", a4r_API_bmp_write_line, 2); // in a4r_API_direct_access_to_video_memory.c
432
+ rb_define_module_function(mAllegro4r_API, "bmp_read_line", a4r_API_bmp_read_line, 2); // in a4r_API_direct_access_to_video_memory.c
433
+ rb_define_module_function(mAllegro4r_API, "bmp_unwrite_line", a4r_API_bmp_unwrite_line, 1); // in a4r_API_direct_access_to_video_memory.c
434
+
435
+ rb_define_module_function(mAllegro4r_API, "install_sound", a4r_API_install_sound, 3); // in a4r_API_sound_init_routines.c
436
+
437
+ rb_define_module_function(mAllegro4r_API, "load_sample", a4r_API_load_sample, 1); // in a4r_API_digital_sample_routines.c
438
+ rb_define_module_function(mAllegro4r_API, "destroy_sample", a4r_API_destroy_sample, 1); // in a4r_API_digital_sample_routines.c
439
+ rb_define_module_function(mAllegro4r_API, "play_sample", a4r_API_play_sample, 5); // in a4r_API_digital_sample_routines.c
440
+ rb_define_module_function(mAllegro4r_API, "adjust_sample", a4r_API_adjust_sample, 5); // in a4r_API_digital_sample_routines.c
441
+
442
+ rb_define_module_function(mAllegro4r_API, "load_midi", a4r_API_load_midi, 1); // in a4r_API_music_routines_midi.c
443
+ rb_define_module_function(mAllegro4r_API, "destroy_midi", a4r_API_destroy_midi, 1); // in a4r_API_music_routines_midi.c
444
+ rb_define_module_function(mAllegro4r_API, "play_midi", a4r_API_play_midi, 2); // in a4r_API_music_routines_midi.c
445
+ rb_define_module_function(mAllegro4r_API, "midi_pause", a4r_API_midi_pause, 0); // in a4r_API_music_routines_midi.c
446
+ rb_define_module_function(mAllegro4r_API, "midi_resume", a4r_API_midi_resume, 0); // in a4r_API_music_routines_midi.c
447
+ rb_define_module_function(mAllegro4r_API, "get_midi_length", a4r_API_get_midi_length, 1); // in a4r_API_music_routines_midi.c
448
+ rb_define_module_function(mAllegro4r_API, "midi_pos", a4r_API_midi_pos, 0); // in a4r_API_music_routines_midi.c
449
+ rb_define_module_function(mAllegro4r_API, "midi_time", a4r_API_midi_time, 0); // in a4r_API_music_routines_midi.c
450
+
451
+ rb_define_module_function(mAllegro4r_API, "get_filename", a4r_API_get_filename, 1); // in a4r_API_file_and_compression_routines.c
452
+
453
+ rb_define_module_function(mAllegro4r_API, "itofix", a4r_API_itofix, 1); // in a4r_API_fixed_point_math_routines.c
454
+ rb_define_module_function(mAllegro4r_API, "ftofix", a4r_API_ftofix, 1); // in a4r_API_fixed_point_math_routines.c
455
+ rb_define_module_function(mAllegro4r_API, "fixtof", a4r_API_fixtof, 1); // in a4r_API_fixed_point_math_routines.c
456
+ rb_define_module_function(mAllegro4r_API, "fixmul", a4r_API_fixmul, 2); // in a4r_API_fixed_point_math_routines.c
457
+ rb_define_module_function(mAllegro4r_API, "fixsqrt", a4r_API_fixsqrt, 1); // in a4r_API_fixed_point_math_routines.c
458
+
459
+ /*
460
+ * GFX_AUTODETECT: Allegro will try to set the specified resolution with the
461
+ * current color depth in fullscreen mode. Failing that, it will try to repeat
462
+ * the same operation in windowed mode.
463
+ */
464
+ rb_define_const(mAllegro4r_API, "GFX_AUTODETECT", INT2FIX(GFX_AUTODETECT));
465
+ /*
466
+ * GFX_AUTODETECT_FULLSCREEN: Allegro will try to set the specified resolution
467
+ * with the current color depth in fullscreen mode.
468
+ */
469
+ rb_define_const(mAllegro4r_API, "GFX_AUTODETECT_FULLSCREEN", INT2FIX(GFX_AUTODETECT_FULLSCREEN));
470
+ /*
471
+ * GFX_AUTODETECT_WINDOWED: Allegro will try to set the specified resolution
472
+ * with the current color depth in a windowed mode.
473
+ */
474
+ rb_define_const(mAllegro4r_API, "GFX_AUTODETECT_WINDOWED", INT2FIX(GFX_AUTODETECT_WINDOWED));
475
+ /*
476
+ * GFX_SAFE: Allegro will try to set the specified resolution. Failing that,
477
+ * it will fall back upon whatever mode is known to be reliable on the current
478
+ * platform. If it absolutely cannot set any graphics mode at all, there's no
479
+ * possible video output on the machine.
480
+ */
481
+ rb_define_const(mAllegro4r_API, "GFX_SAFE", INT2NUM(GFX_SAFE));
482
+ /*
483
+ * GFX_TEXT: Closes any previously opened graphics mode, and in those
484
+ * environments that have text modes, sets one previously used or the closest
485
+ * match to that (usually 80x25).
486
+ */
487
+ rb_define_const(mAllegro4r_API, "GFX_TEXT", INT2FIX(GFX_TEXT));
488
+
489
+ /* SWITCH_NONE: Disables switching. */
490
+ rb_define_const(mAllegro4r_API, "SWITCH_NONE", INT2FIX(SWITCH_NONE));
491
+ /* SWITCH_PAUSE: Pauses the program whenever it is in the background. */
492
+ rb_define_const(mAllegro4r_API, "SWITCH_PAUSE", INT2FIX(SWITCH_PAUSE));
493
+ /*
494
+ * SWITCH_AMNESIA: Like SWITCH_PAUSE, but this mode doesn't bother to remember
495
+ * the contents of video memory, so the screen, and any video bitmaps that you
496
+ * have created, will be erased after the user switches away and then back to
497
+ * your program
498
+ */
499
+ rb_define_const(mAllegro4r_API, "SWITCH_AMNESIA", INT2FIX(SWITCH_AMNESIA));
500
+ /*
501
+ * SWITCH_BACKGROUND: The program will carry on running in the background,
502
+ * with the screen bitmap temporarily being pointed at a memory buffer for the
503
+ * fullscreen drivers
504
+ */
505
+ rb_define_const(mAllegro4r_API, "SWITCH_BACKGROUND", INT2FIX(SWITCH_BACKGROUND));
506
+ /*
507
+ * SWITCH_BACKAMNESIA: Like SWITCH_BACKGROUND, but this mode doesn't bother to
508
+ * remember the contents of video memory
509
+ */
510
+ rb_define_const(mAllegro4r_API, "SWITCH_BACKAMNESIA", INT2FIX(SWITCH_BACKAMNESIA));
511
+
512
+ /* DRAW_MODE_SOLID: The default, solid color drawing */
513
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_SOLID", INT2FIX(DRAW_MODE_SOLID));
514
+ /* DRAW_MODE_XOR: Exclusive-or drawing */
515
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_XOR", INT2FIX(DRAW_MODE_XOR));
516
+ /* DRAW_MODE_COPY_PATTERN: Multicolored pattern fill */
517
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_COPY_PATTERN", INT2FIX(DRAW_MODE_COPY_PATTERN));
518
+ /* DRAW_MODE_SOLID_PATTERN: Single color pattern fill */
519
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_SOLID_PATTERN", INT2FIX(DRAW_MODE_SOLID_PATTERN));
520
+ /* DRAW_MODE_MASKED_PATTERN: Masked pattern fill */
521
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_MASKED_PATTERN", INT2FIX(DRAW_MODE_MASKED_PATTERN));
522
+ /* DRAW_MODE_TRANS: Translucent color blending */
523
+ rb_define_const(mAllegro4r_API, "DRAW_MODE_TRANS", INT2FIX(DRAW_MODE_TRANS));
524
+
525
+ /* KB_SHIFT_FLAG: */
526
+ rb_define_const(mAllegro4r_API, "KB_SHIFT_FLAG", INT2FIX(KB_SHIFT_FLAG));
527
+ /* KB_CTRL_FLAG: */
528
+ rb_define_const(mAllegro4r_API, "KB_CTRL_FLAG", INT2FIX(KB_CTRL_FLAG));
529
+ /* KB_ALT_FLAG: */
530
+ rb_define_const(mAllegro4r_API, "KB_ALT_FLAG", INT2FIX(KB_ALT_FLAG));
531
+ /* KB_LWIN_FLAG: */
532
+ rb_define_const(mAllegro4r_API, "KB_LWIN_FLAG", INT2FIX(KB_LWIN_FLAG));
533
+ /* KB_RWIN_FLAG: */
534
+ rb_define_const(mAllegro4r_API, "KB_RWIN_FLAG", INT2FIX(KB_RWIN_FLAG));
535
+ /* KB_MENU_FLAG: */
536
+ rb_define_const(mAllegro4r_API, "KB_MENU_FLAG", INT2FIX(KB_MENU_FLAG));
537
+ /* KB_COMMAND_FLAG: */
538
+ rb_define_const(mAllegro4r_API, "KB_COMMAND_FLAG", INT2FIX(KB_COMMAND_FLAG));
539
+ /* KB_SCROLOCK_FLAG: */
540
+ rb_define_const(mAllegro4r_API, "KB_SCROLOCK_FLAG", INT2FIX(KB_SCROLOCK_FLAG));
541
+ /* KB_NUMLOCK_FLAG: */
542
+ rb_define_const(mAllegro4r_API, "KB_NUMLOCK_FLAG", INT2FIX(KB_NUMLOCK_FLAG));
543
+ /* KB_CAPSLOCK_FLAG: */
544
+ rb_define_const(mAllegro4r_API, "KB_CAPSLOCK_FLAG", INT2FIX(KB_CAPSLOCK_FLAG));
545
+ /* KB_INALTSEQ_FLAG: */
546
+ rb_define_const(mAllegro4r_API, "KB_INALTSEQ_FLAG", INT2FIX(KB_INALTSEQ_FLAG));
547
+ /* KB_ACCENT1_FLAG: */
548
+ rb_define_const(mAllegro4r_API, "KB_ACCENT1_FLAG", INT2FIX(KB_ACCENT1_FLAG));
549
+ /* KB_ACCENT2_FLAG: */
550
+ rb_define_const(mAllegro4r_API, "KB_ACCENT2_FLAG", INT2FIX(KB_ACCENT2_FLAG));
551
+ /* KB_ACCENT3_FLAG: */
552
+ rb_define_const(mAllegro4r_API, "KB_ACCENT3_FLAG", INT2FIX(KB_ACCENT3_FLAG));
553
+ /* KB_ACCENT4_FLAG: */
554
+ rb_define_const(mAllegro4r_API, "KB_ACCENT4_FLAG", INT2FIX(KB_ACCENT4_FLAG));
555
+ /* KEY_A: */
556
+ rb_define_const(mAllegro4r_API, "KEY_A", INT2FIX(KEY_A));
557
+ /* KEY_B: */
558
+ rb_define_const(mAllegro4r_API, "KEY_B", INT2FIX(KEY_B));
559
+ /* KEY_C: */
560
+ rb_define_const(mAllegro4r_API, "KEY_C", INT2FIX(KEY_C));
561
+ /* KEY_D: */
562
+ rb_define_const(mAllegro4r_API, "KEY_D", INT2FIX(KEY_D));
563
+ /* KEY_E: */
564
+ rb_define_const(mAllegro4r_API, "KEY_E", INT2FIX(KEY_E));
565
+ /* KEY_F: */
566
+ rb_define_const(mAllegro4r_API, "KEY_F", INT2FIX(KEY_F));
567
+ /* KEY_G: */
568
+ rb_define_const(mAllegro4r_API, "KEY_G", INT2FIX(KEY_G));
569
+ /* KEY_H: */
570
+ rb_define_const(mAllegro4r_API, "KEY_H", INT2FIX(KEY_H));
571
+ /* KEY_I: */
572
+ rb_define_const(mAllegro4r_API, "KEY_I", INT2FIX(KEY_I));
573
+ /* KEY_J: */
574
+ rb_define_const(mAllegro4r_API, "KEY_J", INT2FIX(KEY_J));
575
+ /* KEY_K: */
576
+ rb_define_const(mAllegro4r_API, "KEY_K", INT2FIX(KEY_K));
577
+ /* KEY_L: */
578
+ rb_define_const(mAllegro4r_API, "KEY_L", INT2FIX(KEY_L));
579
+ /* KEY_M: */
580
+ rb_define_const(mAllegro4r_API, "KEY_M", INT2FIX(KEY_M));
581
+ /* KEY_N: */
582
+ rb_define_const(mAllegro4r_API, "KEY_N", INT2FIX(KEY_N));
583
+ /* KEY_O: */
584
+ rb_define_const(mAllegro4r_API, "KEY_O", INT2FIX(KEY_O));
585
+ /* KEY_P: */
586
+ rb_define_const(mAllegro4r_API, "KEY_P", INT2FIX(KEY_P));
587
+ /* KEY_Q: */
588
+ rb_define_const(mAllegro4r_API, "KEY_Q", INT2FIX(KEY_Q));
589
+ /* KEY_R: */
590
+ rb_define_const(mAllegro4r_API, "KEY_R", INT2FIX(KEY_R));
591
+ /* KEY_S: */
592
+ rb_define_const(mAllegro4r_API, "KEY_S", INT2FIX(KEY_S));
593
+ /* KEY_T: */
594
+ rb_define_const(mAllegro4r_API, "KEY_T", INT2FIX(KEY_T));
595
+ /* KEY_U: */
596
+ rb_define_const(mAllegro4r_API, "KEY_U", INT2FIX(KEY_U));
597
+ /* KEY_V: */
598
+ rb_define_const(mAllegro4r_API, "KEY_V", INT2FIX(KEY_V));
599
+ /* KEY_W: */
600
+ rb_define_const(mAllegro4r_API, "KEY_W", INT2FIX(KEY_W));
601
+ /* KEY_X: */
602
+ rb_define_const(mAllegro4r_API, "KEY_X", INT2FIX(KEY_X));
603
+ /* KEY_Y: */
604
+ rb_define_const(mAllegro4r_API, "KEY_Y", INT2FIX(KEY_Y));
605
+ /* KEY_Z: */
606
+ rb_define_const(mAllegro4r_API, "KEY_Z", INT2FIX(KEY_Z));
607
+ /* KEY_0: */
608
+ rb_define_const(mAllegro4r_API, "KEY_0", INT2FIX(KEY_0));
609
+ /* KEY_1: */
610
+ rb_define_const(mAllegro4r_API, "KEY_1", INT2FIX(KEY_1));
611
+ /* KEY_2: */
612
+ rb_define_const(mAllegro4r_API, "KEY_2", INT2FIX(KEY_2));
613
+ /* KEY_3: */
614
+ rb_define_const(mAllegro4r_API, "KEY_3", INT2FIX(KEY_3));
615
+ /* KEY_4: */
616
+ rb_define_const(mAllegro4r_API, "KEY_4", INT2FIX(KEY_4));
617
+ /* KEY_5: */
618
+ rb_define_const(mAllegro4r_API, "KEY_5", INT2FIX(KEY_5));
619
+ /* KEY_6: */
620
+ rb_define_const(mAllegro4r_API, "KEY_6", INT2FIX(KEY_6));
621
+ /* KEY_7: */
622
+ rb_define_const(mAllegro4r_API, "KEY_7", INT2FIX(KEY_7));
623
+ /* KEY_8: */
624
+ rb_define_const(mAllegro4r_API, "KEY_8", INT2FIX(KEY_8));
625
+ /* KEY_9: */
626
+ rb_define_const(mAllegro4r_API, "KEY_9", INT2FIX(KEY_9));
627
+ /* KEY_0_PAD: */
628
+ rb_define_const(mAllegro4r_API, "KEY_0_PAD", INT2FIX(KEY_0_PAD));
629
+ /* KEY_1_PAD: */
630
+ rb_define_const(mAllegro4r_API, "KEY_1_PAD", INT2FIX(KEY_1_PAD));
631
+ /* KEY_2_PAD: */
632
+ rb_define_const(mAllegro4r_API, "KEY_2_PAD", INT2FIX(KEY_2_PAD));
633
+ /* KEY_3_PAD: */
634
+ rb_define_const(mAllegro4r_API, "KEY_3_PAD", INT2FIX(KEY_3_PAD));
635
+ /* KEY_4_PAD: */
636
+ rb_define_const(mAllegro4r_API, "KEY_4_PAD", INT2FIX(KEY_4_PAD));
637
+ /* KEY_5_PAD: */
638
+ rb_define_const(mAllegro4r_API, "KEY_5_PAD", INT2FIX(KEY_5_PAD));
639
+ /* KEY_6_PAD: */
640
+ rb_define_const(mAllegro4r_API, "KEY_6_PAD", INT2FIX(KEY_6_PAD));
641
+ /* KEY_7_PAD: */
642
+ rb_define_const(mAllegro4r_API, "KEY_7_PAD", INT2FIX(KEY_7_PAD));
643
+ /* KEY_8_PAD: */
644
+ rb_define_const(mAllegro4r_API, "KEY_8_PAD", INT2FIX(KEY_8_PAD));
645
+ /* KEY_9_PAD: */
646
+ rb_define_const(mAllegro4r_API, "KEY_9_PAD", INT2FIX(KEY_9_PAD));
647
+ /* KEY_F1: */
648
+ rb_define_const(mAllegro4r_API, "KEY_F1", INT2FIX(KEY_F1));
649
+ /* KEY_F2: */
650
+ rb_define_const(mAllegro4r_API, "KEY_F2", INT2FIX(KEY_F2));
651
+ /* KEY_F3: */
652
+ rb_define_const(mAllegro4r_API, "KEY_F3", INT2FIX(KEY_F3));
653
+ /* KEY_F4: */
654
+ rb_define_const(mAllegro4r_API, "KEY_F4", INT2FIX(KEY_F4));
655
+ /* KEY_F5: */
656
+ rb_define_const(mAllegro4r_API, "KEY_F5", INT2FIX(KEY_F5));
657
+ /* KEY_F6: */
658
+ rb_define_const(mAllegro4r_API, "KEY_F6", INT2FIX(KEY_F6));
659
+ /* KEY_F7: */
660
+ rb_define_const(mAllegro4r_API, "KEY_F7", INT2FIX(KEY_F7));
661
+ /* KEY_F8: */
662
+ rb_define_const(mAllegro4r_API, "KEY_F8", INT2FIX(KEY_F8));
663
+ /* KEY_F9: */
664
+ rb_define_const(mAllegro4r_API, "KEY_F9", INT2FIX(KEY_F9));
665
+ /* KEY_F10: */
666
+ rb_define_const(mAllegro4r_API, "KEY_F10", INT2FIX(KEY_F10));
667
+ /* KEY_F11: */
668
+ rb_define_const(mAllegro4r_API, "KEY_F11", INT2FIX(KEY_F11));
669
+ /* KEY_F12: */
670
+ rb_define_const(mAllegro4r_API, "KEY_F12", INT2FIX(KEY_F12));
671
+ /* KEY_ESC: */
672
+ rb_define_const(mAllegro4r_API, "KEY_ESC", INT2FIX(KEY_ESC));
673
+ /* KEY_TILDE: */
674
+ rb_define_const(mAllegro4r_API, "KEY_TILDE", INT2FIX(KEY_TILDE));
675
+ /* KEY_MINUS: */
676
+ rb_define_const(mAllegro4r_API, "KEY_MINUS", INT2FIX(KEY_MINUS));
677
+ /* KEY_EQUALS: */
678
+ rb_define_const(mAllegro4r_API, "KEY_EQUALS", INT2FIX(KEY_EQUALS));
679
+ /* KEY_BACKSPACE: */
680
+ rb_define_const(mAllegro4r_API, "KEY_BACKSPACE", INT2FIX(KEY_BACKSPACE));
681
+ /* KEY_TAB: */
682
+ rb_define_const(mAllegro4r_API, "KEY_TAB", INT2FIX(KEY_TAB));
683
+ /* KEY_OPENBRACE: */
684
+ rb_define_const(mAllegro4r_API, "KEY_OPENBRACE", INT2FIX(KEY_OPENBRACE));
685
+ /* KEY_CLOSEBRACE: */
686
+ rb_define_const(mAllegro4r_API, "KEY_CLOSEBRACE", INT2FIX(KEY_CLOSEBRACE));
687
+ /* KEY_ENTER: */
688
+ rb_define_const(mAllegro4r_API, "KEY_ENTER", INT2FIX(KEY_ENTER));
689
+ /* KEY_COLON: */
690
+ rb_define_const(mAllegro4r_API, "KEY_COLON", INT2FIX(KEY_COLON));
691
+ /* KEY_QUOTE: */
692
+ rb_define_const(mAllegro4r_API, "KEY_QUOTE", INT2FIX(KEY_QUOTE));
693
+ /* KEY_BACKSLASH: */
694
+ rb_define_const(mAllegro4r_API, "KEY_BACKSLASH", INT2FIX(KEY_BACKSLASH));
695
+ /* KEY_BACKSLASH2: */
696
+ rb_define_const(mAllegro4r_API, "KEY_BACKSLASH2", INT2FIX(KEY_BACKSLASH2));
697
+ /* KEY_COMMA: */
698
+ rb_define_const(mAllegro4r_API, "KEY_COMMA", INT2FIX(KEY_COMMA));
699
+ /* KEY_STOP: */
700
+ rb_define_const(mAllegro4r_API, "KEY_STOP", INT2FIX(KEY_STOP));
701
+ /* KEY_SLASH: */
702
+ rb_define_const(mAllegro4r_API, "KEY_SLASH", INT2FIX(KEY_SLASH));
703
+ /* KEY_SPACE: */
704
+ rb_define_const(mAllegro4r_API, "KEY_SPACE", INT2FIX(KEY_SPACE));
705
+ /* KEY_INSERT: */
706
+ rb_define_const(mAllegro4r_API, "KEY_INSERT", INT2FIX(KEY_INSERT));
707
+ /* KEY_DEL: */
708
+ rb_define_const(mAllegro4r_API, "KEY_DEL", INT2FIX(KEY_DEL));
709
+ /* KEY_HOME: */
710
+ rb_define_const(mAllegro4r_API, "KEY_HOME", INT2FIX(KEY_HOME));
711
+ /* KEY_END: */
712
+ rb_define_const(mAllegro4r_API, "KEY_END", INT2FIX(KEY_END));
713
+ /* KEY_PGUP: */
714
+ rb_define_const(mAllegro4r_API, "KEY_PGUP", INT2FIX(KEY_PGUP));
715
+ /* KEY_PGDN: */
716
+ rb_define_const(mAllegro4r_API, "KEY_PGDN", INT2FIX(KEY_PGDN));
717
+ /* KEY_LEFT: */
718
+ rb_define_const(mAllegro4r_API, "KEY_LEFT", INT2FIX(KEY_LEFT));
719
+ /* KEY_RIGHT: */
720
+ rb_define_const(mAllegro4r_API, "KEY_RIGHT", INT2FIX(KEY_RIGHT));
721
+ /* KEY_UP: */
722
+ rb_define_const(mAllegro4r_API, "KEY_UP", INT2FIX(KEY_UP));
723
+ /* KEY_DOWN: */
724
+ rb_define_const(mAllegro4r_API, "KEY_DOWN", INT2FIX(KEY_DOWN));
725
+ /* KEY_SLASH_PAD: */
726
+ rb_define_const(mAllegro4r_API, "KEY_SLASH_PAD", INT2FIX(KEY_SLASH_PAD));
727
+ /* KEY_ASTERISK: */
728
+ rb_define_const(mAllegro4r_API, "KEY_ASTERISK", INT2FIX(KEY_ASTERISK));
729
+ /* KEY_MINUS_PAD: */
730
+ rb_define_const(mAllegro4r_API, "KEY_MINUS_PAD", INT2FIX(KEY_MINUS_PAD));
731
+ /* KEY_PLUS_PAD: */
732
+ rb_define_const(mAllegro4r_API, "KEY_PLUS_PAD", INT2FIX(KEY_PLUS_PAD));
733
+ /* KEY_DEL_PAD: */
734
+ rb_define_const(mAllegro4r_API, "KEY_DEL_PAD", INT2FIX(KEY_DEL_PAD));
735
+ /* KEY_ENTER_PAD: */
736
+ rb_define_const(mAllegro4r_API, "KEY_ENTER_PAD", INT2FIX(KEY_ENTER_PAD));
737
+ /* KEY_PRTSCR: */
738
+ rb_define_const(mAllegro4r_API, "KEY_PRTSCR", INT2FIX(KEY_PRTSCR));
739
+ /* KEY_PAUSE: */
740
+ rb_define_const(mAllegro4r_API, "KEY_PAUSE", INT2FIX(KEY_PAUSE));
741
+ /* KEY_ABNT_C1: */
742
+ rb_define_const(mAllegro4r_API, "KEY_ABNT_C1", INT2FIX(KEY_ABNT_C1));
743
+ /* KEY_YEN: */
744
+ rb_define_const(mAllegro4r_API, "KEY_YEN", INT2FIX(KEY_YEN));
745
+ /* KEY_KANA: */
746
+ rb_define_const(mAllegro4r_API, "KEY_KANA", INT2FIX(KEY_KANA));
747
+ /* KEY_CONVERT: */
748
+ rb_define_const(mAllegro4r_API, "KEY_CONVERT", INT2FIX(KEY_CONVERT));
749
+ /* KEY_NOCONVERT: */
750
+ rb_define_const(mAllegro4r_API, "KEY_NOCONVERT", INT2FIX(KEY_NOCONVERT));
751
+ /* KEY_AT: */
752
+ rb_define_const(mAllegro4r_API, "KEY_AT", INT2FIX(KEY_AT));
753
+ /* KEY_CIRCUMFLEX: */
754
+ rb_define_const(mAllegro4r_API, "KEY_CIRCUMFLEX", INT2FIX(KEY_CIRCUMFLEX));
755
+ /* KEY_COLON2: */
756
+ rb_define_const(mAllegro4r_API, "KEY_COLON2", INT2FIX(KEY_COLON2));
757
+ /* KEY_KANJI: */
758
+ rb_define_const(mAllegro4r_API, "KEY_KANJI", INT2FIX(KEY_KANJI));
759
+ /* KEY_EQUALS_PAD: MacOS X*/
760
+ rb_define_const(mAllegro4r_API, "KEY_EQUALS_PAD", INT2FIX(KEY_EQUALS_PAD));
761
+ /* KEY_BACKQUOTE: MacOS X*/
762
+ rb_define_const(mAllegro4r_API, "KEY_BACKQUOTE", INT2FIX(KEY_BACKQUOTE));
763
+ /* KEY_SEMICOLON: MacOS X*/
764
+ rb_define_const(mAllegro4r_API, "KEY_SEMICOLON", INT2FIX(KEY_SEMICOLON));
765
+ /* KEY_COMMAND: MacOS X*/
766
+ rb_define_const(mAllegro4r_API, "KEY_COMMAND", INT2FIX(KEY_COMMAND));
767
+ /* KEY_UNKNOWN1: */
768
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN1", INT2FIX(KEY_UNKNOWN1));
769
+ /* KEY_UNKNOWN2: */
770
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN2", INT2FIX(KEY_UNKNOWN2));
771
+ /* KEY_UNKNOWN3: */
772
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN3", INT2FIX(KEY_UNKNOWN3));
773
+ /* KEY_UNKNOWN4: */
774
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN4", INT2FIX(KEY_UNKNOWN4));
775
+ /* KEY_UNKNOWN5: */
776
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN5", INT2FIX(KEY_UNKNOWN5));
777
+ /* KEY_UNKNOWN6: */
778
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN6", INT2FIX(KEY_UNKNOWN6));
779
+ /* KEY_UNKNOWN7: */
780
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN7", INT2FIX(KEY_UNKNOWN7));
781
+ /* KEY_UNKNOWN8: */
782
+ rb_define_const(mAllegro4r_API, "KEY_UNKNOWN8", INT2FIX(KEY_UNKNOWN8));
783
+ /* KEY_MODIFIERS: */
784
+ rb_define_const(mAllegro4r_API, "KEY_MODIFIERS", INT2FIX(KEY_MODIFIERS));
785
+ /* KEY_LSHIFT: */
786
+ rb_define_const(mAllegro4r_API, "KEY_LSHIFT", INT2FIX(KEY_LSHIFT));
787
+ /* KEY_RSHIFT: */
788
+ rb_define_const(mAllegro4r_API, "KEY_RSHIFT", INT2FIX(KEY_RSHIFT));
789
+ /* KEY_LCONTROL: */
790
+ rb_define_const(mAllegro4r_API, "KEY_LCONTROL", INT2FIX(KEY_LCONTROL));
791
+ /* KEY_RCONTROL: */
792
+ rb_define_const(mAllegro4r_API, "KEY_RCONTROL", INT2FIX(KEY_RCONTROL));
793
+ /* KEY_ALT: */
794
+ rb_define_const(mAllegro4r_API, "KEY_ALT", INT2FIX(KEY_ALT));
795
+ /* KEY_ALTGR: */
796
+ rb_define_const(mAllegro4r_API, "KEY_ALTGR", INT2FIX(KEY_ALTGR));
797
+ /* KEY_LWIN: */
798
+ rb_define_const(mAllegro4r_API, "KEY_LWIN", INT2FIX(KEY_LWIN));
799
+ /* KEY_RWIN: */
800
+ rb_define_const(mAllegro4r_API, "KEY_RWIN", INT2FIX(KEY_RWIN));
801
+ /* KEY_MENU: */
802
+ rb_define_const(mAllegro4r_API, "KEY_MENU", INT2FIX(KEY_MENU));
803
+ /* KEY_SCRLOCK: */
804
+ rb_define_const(mAllegro4r_API, "KEY_SCRLOCK", INT2FIX(KEY_SCRLOCK));
805
+ /* KEY_NUMLOCK: */
806
+ rb_define_const(mAllegro4r_API, "KEY_NUMLOCK", INT2FIX(KEY_NUMLOCK));
807
+ /* KEY_CAPSLOCK: */
808
+ rb_define_const(mAllegro4r_API, "KEY_CAPSLOCK", INT2FIX(KEY_CAPSLOCK));
809
+ /* KEY_MAX: */
810
+ rb_define_const(mAllegro4r_API, "KEY_MAX", INT2FIX(KEY_MAX));
811
+
812
+ /* JOY_TYPE_AUTODETECT: */
813
+ rb_define_const(mAllegro4r_API, "JOY_TYPE_AUTODETECT", INT2FIX(JOY_TYPE_AUTODETECT));
814
+ /* JOY_TYPE_NONE: */
815
+ rb_define_const(mAllegro4r_API, "JOY_TYPE_NONE", INT2FIX(JOY_TYPE_NONE));
816
+
817
+ /* JOYFLAG_DIGITAL: This control is currently providing digital input. */
818
+ rb_define_const(mAllegro4r_API, "JOYFLAG_DIGITAL", INT2FIX(JOYFLAG_DIGITAL));
819
+ /* JOYFLAG_ANALOGUE: This control is currently providing analogue input. */
820
+ rb_define_const(mAllegro4r_API, "JOYFLAG_ANALOGUE", INT2FIX(JOYFLAG_ANALOGUE));
821
+ /*
822
+ * JOYFLAG_CALIB_DIGITAL: This control will be capable of providing digital
823
+ * input once it has been calibrated, but is not doing this at the moment.
824
+ */
825
+ rb_define_const(mAllegro4r_API, "JOYFLAG_CALIB_DIGITAL", INT2FIX(JOYFLAG_CALIB_DIGITAL));
826
+ /*
827
+ * JOYFLAG_CALIB_ANALOGUE: This control will be capable of providing analogue
828
+ * input once it has been calibrated, but is not doing this at the moment.
829
+ */
830
+ rb_define_const(mAllegro4r_API, "JOYFLAG_CALIB_ANALOGUE", INT2FIX(JOYFLAG_CALIB_ANALOGUE));
831
+ /*
832
+ * JOYFLAG_CALIBRATE: Indicates that this control needs to be calibrated. Many
833
+ * devices require multiple calibration steps, so you should call the
834
+ * calibrate_joystick function from a loop until this flag is cleared.
835
+ */
836
+ rb_define_const(mAllegro4r_API, "JOYFLAG_CALIBRATE", INT2FIX(JOYFLAG_CALIBRATE));
837
+ /*
838
+ * JOYFLAG_SIGNED: Indicates that the analogue axis position is in signed
839
+ * format, ranging from -128 to 128. This is the case for all 2d directional
840
+ * controls.
841
+ */
842
+ rb_define_const(mAllegro4r_API, "JOYFLAG_SIGNED", INT2FIX(JOYFLAG_SIGNED));
843
+ /*
844
+ * JOYFLAG_UNSIGNED: Indicates that the analogue axis position is in unsigned
845
+ * format, ranging from 0 to 255. This is the case for all 1d throttle
846
+ * controls.
847
+ */
848
+ rb_define_const(mAllegro4r_API, "JOYFLAG_UNSIGNED", INT2FIX(JOYFLAG_UNSIGNED));
849
+
850
+ /* DIGI_AUTODETECT: Let Allegro pick a digital sound driver */
851
+ rb_define_const(mAllegro4r_API, "DIGI_AUTODETECT", INT2FIX(DIGI_AUTODETECT));
852
+ /* DIGI_NONE: No digital sound */
853
+ rb_define_const(mAllegro4r_API, "DIGI_NONE", INT2FIX(DIGI_NONE));
854
+
855
+ /* MIDI_AUTODETECT: Let Allegro pick a MIDI sound driver */
856
+ rb_define_const(mAllegro4r_API, "MIDI_AUTODETECT", INT2FIX(MIDI_AUTODETECT));
857
+ /* MIDI_NONE: No MIDI sound */
858
+ rb_define_const(mAllegro4r_API, "MIDI_NONE", INT2FIX(MIDI_NONE));
859
+ }
860
+
861
+ // needed if Allegro is built as a shared library
862
+ int main()
863
+ {
864
+ return 0;
865
+ }
866
+ END_OF_MAIN()