With Allegro comes quite a bunch of examples, which go from the simple introductory `Hello world' to more complicated programs featuring truecolor blending effects. This chapter describes these examples which you can find in the allegro/examples folder. You don't have to go through them in the same order as this documentation, but doing so you will learn the basic functions and avoid missing any important bit of information.
See also: END_OF_MAIN, acquire_screen, allegro_error, allegro_init, allegro_message, clear_to_color, desktop_palette, font, install_keyboard, makecol, readkey, release_screen, screen, set_gfx_mode, set_palette.
See also: BITMAP, END_OF_MAIN, acquire_screen, allegro_error, allegro_init, allegro_message, circle, clear_bitmap, create_bitmap, desktop_palette, destroy_bitmap, install_keyboard, palette_color, readkey, release_screen, screen, set_gfx_mode, set_palette.
See also: END_OF_MAIN, PALETTE, RGB, acquire_screen, allegro_error, allegro_init, allegro_message, black_palette, circlefill, install_keyboard, keypressed, release_screen, screen, set_gfx_mode, set_palette.
See also: BITMAP, END_OF_MAIN, acquire_bitmap, allegro_error, allegro_init, allegro_message, bitmap_mask_color, clear_to_color, create_bitmap, create_sub_bitmap, desktop_palette, destroy_bitmap, drawing_mode, font, install_keyboard, makecol, palette_color, readkey, rectfill, release_bitmap, screen, set_gfx_mode, set_palette, solid_mode, text_height, text_length.
See also: END_OF_MAIN, PALETTE, acquire_screen, allegro_error, allegro_init, allegro_message, clear_keybuf, font, getpixel, install_keyboard, keypressed, line, makecol, putpixel, release_screen, screen, set_gfx_mode, set_palette.
See also: BITMAP, END_OF_MAIN, acquire_screen, allegro_error, allegro_init, allegro_message, circlefill, clear_to_color, create_bitmap, desktop_palette, destroy_bitmap, font, install_timer, makecol, release_screen, retrace_count, screen, set_gfx_mode, set_palette.
See also: BITMAP, END_OF_MAIN, allegro_error, allegro_init, allegro_message, circlefill, clear_to_color, create_bitmap, create_video_bitmap, desktop_palette, destroy_bitmap, font, install_timer, makecol, retrace_count, screen, set_gfx_mode, set_palette, show_video_bitmap.
See also: END_OF_MAIN, allegro_init, allegro_message, fixdiv, fixed, fixmul, fixsqrt, fixtof, ftofix, itofix.
See also: BITMAP, END_OF_MAIN, acquire_screen, allegro_error, allegro_init, allegro_message, bitmap_mask_color, circle, clear_keybuf, clear_to_color, create_bitmap, desktop_palette, destroy_bitmap, font, get_mouse_mickeys, install_keyboard, install_mouse, install_timer, key, keypressed, makecol, mouse_b, mouse_x, mouse_y, mouse_z, palette_color, poll_mouse, readkey, release_screen, screen, set_gfx_mode, set_mouse_sprite, set_mouse_sprite_focus, set_palette, show_mouse, vsync.
See also: END_OF_MAIN, allegro_error, allegro_init, allegro_message, clear_to_color, desktop_palette, font, install_int, install_int_ex, install_keyboard, install_timer, key, keypressed, makecol, readkey, rest, screen, set_gfx_mode, set_palette.
See also: END_OF_MAIN, acquire_screen, allegro_error, allegro_init, allegro_message, clear_keybuf, clear_to_color, desktop_palette, font, install_keyboard, key, key_shifts, makecol, readkey, rectfill, release_screen, screen, set_gfx_mode, set_palette, ureadkey, usprintf.
See also: BITMAP, END_OF_MAIN, allegro_error, allegro_init, allegro_message, calibrate_joystick, calibrate_joystick_name, circle, clear_bitmap, clear_keybuf, create_bitmap, default_palette, destroy_bitmap, drawing_mode, font, install_joystick, install_keyboard, joy, key, keypressed, num_joysticks, palette_color, poll_joystick, putpixel, readkey, screen, set_gfx_mode, set_palette.
See also: END_OF_MAIN, SAMPLE, adjust_sample, allegro_error, allegro_init, allegro_message, clear_to_color, desktop_palette, destroy_sample, font, install_keyboard, install_sound, install_timer, key, load_sample, makecol, play_sample, poll_keyboard, rest, screen, set_gfx_mode, set_palette.
See also: END_OF_MAIN, MIDI, allegro_error, allegro_init, allegro_message, clear_to_color, desktop_palette, destroy_midi, font, install_keyboard, install_sound, install_timer, load_midi, makecol, play_midi, readkey, screen, set_gfx_mode, set_palette.
See also: DATAFILE, DIALOG, END_OF_MAIN, MENU, active_menu, alert, allegro_error, allegro_init, allegro_message, d_bitmap_proc, d_box_proc, d_button_proc, d_check_proc, d_clear_proc, d_ctext_proc, d_edit_proc, d_icon_proc, d_keyboard_proc, d_list_proc, d_menu_proc, d_radio_proc, d_rtext_proc, d_shadow_box_proc, d_slider_proc, d_text_list_proc, d_text_proc, d_textbox_proc, d_yield_proc, do_dialog, gui_bg_color, gui_fg_color, gui_mg_color, install_keyboard, install_mouse, install_timer, key, load_datafile, makecol, position_dialog, screen, set_dialog_color, set_gfx_mode, set_palette, unload_datafile, ustrtok, ustrzcat, ustrzcpy, uszprintf.
See also: BITMAP, DATAFILE, DIALOG, END_OF_MAIN, FONT, allegro_error, allegro_init, allegro_message, circle, circlefill, clear_to_color, create_bitmap, d_button_proc, d_check_proc, d_clear_proc, d_edit_proc, desktop_palette, destroy_bitmap, do_dialog, fixcos, fixed, fixmul, fixsin, fixtoi, font, install_keyboard, install_mouse, install_timer, itofix, key, line, load_datafile, makecol, object_message, screen, set_gfx_mode, set_palette, unload_datafile.
See also: BITMAP, DATAFILE, END_OF_MAIN, FONT, allegro_error, allegro_init, allegro_message, clear_to_color, create_system_bitmap, destroy_bitmap, font, install_keyboard, install_timer, keypressed, load_datafile, makecol, rest, screen, set_gfx_mode, set_uformat, set_window_title, text_height, text_length, uconvert_ascii, unload_datafile, ustrcat, ustrcpy, ustrsize, ustrsizez.
See also: BITMAP, END_OF_MAIN, RGB, allegro_init, allegro_message, clear_bitmap, font, get_config_argv, get_config_int, install_keyboard, line, load_bitmap, makecol, pop_config_state, push_config_state, readkey, screen, set_color_depth, set_config_file, set_gfx_mode, set_palette, ustrdup, ustricmp.
See also: BITMAP, END_OF_MAIN, PALETTE, allegro_error, allegro_init, allegro_message, destroy_bitmap, install_keyboard, load_bitmap, readkey, screen, set_gfx_mode, set_palette.
See also: BITMAP, END_OF_MAIN, PALETTE, allegro_error, allegro_init, allegro_message, destroy_bitmap, install_keyboard, keypressed, load_pcx, screen, set_gfx_mode, set_palette, vsync.
See also: DATAFILE, END_OF_MAIN, allegro_error, allegro_init, allegro_message, font, install_keyboard, load_datafile, makecol, readkey, screen, set_color_conversion, set_gfx_mode, set_palette, unload_datafile.
A short explanation for beginners. Why did I do animate () routine in that way? As you probably know, VIDEO RAM is much slower than "normal" RAM, so it's advisable to reduce VRAM blits to a minimum. So, drawing sprite on the screen (I mean in VRAM) and then clearing a background for him is not very fast. I've used a different method which is much faster, but require a bit more memory. I clear a buffer (it's a normal BITMAP), then I draw sprite to it, and after all I blit only one time this buffer to the screen. So, I'm using a single VRAM blit instead of blitting/clearing background and drawing a sprite on it. It's a good method even when I have to restore. background And of course, it completely remove flickering effect. When one uses a big (ie. 800x600 background) and draws something on it, it's wise to use a copy of background somewhere in memory and restore background using this "virtual background". When blitting from VRAM in SVGA modes, it's probably, that drawing routines have to switch banks on video card. I think, I don't have to remind how slow is it.
See also: BITMAP, DATAFILE, END_OF_MAIN, allegro_error, allegro_init, allegro_message, clear_bitmap, clear_keybuf, create_bitmap, destroy_bitmap, draw_sprite, draw_sprite_h_flip, draw_sprite_v_flip, draw_sprite_vh_flip, fixed, font, install_keyboard, itofix, key, keypressed, load_datafile, palette_color, rectfill, rotate_sprite, rotate_sprite_v_flip, screen, set_color_conversion, set_gfx_mode, set_palette, unload_datafile, vsync.
You may ask: how do you compile, append and exec your program?
Answer: like this...
1) Compile your program like normal. Use the magic filenames with '#' to load your data where needed.
2) Once you compressed your program, run "exedat foo.exe data.dat"
3) Finally run your program.
See also: DATAFILE, END_OF_MAIN, allegro_error, allegro_init, allegro_message, font, install_keyboard, line, load_datafile, makecol, readkey, screen, set_color_conversion, set_gfx_mode, set_palette, unload_datafile.
See also: BITMAP, COLOR_MAP, END_OF_MAIN, PALETTE, RGB, RGB_MAP, allegro_error, allegro_init, allegro_message, bitmap_color_depth, circlefill, clear_bitmap, clear_keybuf, color_map, create_bitmap, create_bitmap_ex, destroy_bitmap, draw_trans_sprite, drawing_mode, install_keyboard, install_mouse, install_timer, keypressed, load_bitmap, mouse_x, mouse_y, poll_mouse, rectfill, rgb_map, screen, set_alpha_blender, set_gfx_mode, set_palette, set_trans_blender, set_write_alpha_blender.
See also: END_OF_MAIN, PALETTE, RGB, acquire_screen, allegro_init, clear_to_color, font, generate_332_palette, install_keyboard, key, makecol, readkey, release_screen, screen, set_color_depth, set_gfx_mode, set_palette, vline.
See also: BITMAP, COLOR_MAP, END_OF_MAIN, PALETTE, RGB, RGB_MAP, allegro_error, allegro_init, allegro_message, circlefill, clear_keybuf, color_map, create_bitmap, destroy_bitmap, drawing_mode, font, generate_332_palette, install_keyboard, keypressed, makecol, rectfill, rgb_map, screen, set_gfx_mode, set_palette, vsync.
See also: BITMAP, DIALOG, END_OF_MAIN, PALETTE, RGB, RGB_MAP, allegro_error, allegro_init, allegro_message, clear_to_color, create_bitmap_ex, d_bitmap_proc, d_box_proc, d_slider_proc, d_text_proc, do_dialog, font, generate_332_palette, get_color_depth, hsv_to_rgb, install_keyboard, install_mouse, install_timer, key, makecol, makecol32, makecol8, object_message, rgb_map, rgb_to_hsv, screen, set_color, set_color_depth, set_gfx_mode, set_palette, vline, vsync.
See also: BITMAP, COLOR_MAP, END_OF_MAIN, PALETTE, RGB, RGB_MAP, allegro_error, allegro_init, allegro_message, clear_bitmap, color_map, create_bitmap, destroy_bitmap, font, install_keyboard, install_mouse, keypressed, load_bitmap, mouse_x, mouse_y, palette_color, poll_mouse, rgb_map, screen, set_gfx_mode, set_palette, set_trans_blender, show_mouse.
See also: BITMAP, END_OF_MAIN, PALETTE, allegro_error, allegro_exit, allegro_init, allegro_message, create_bitmap, destroy_bitmap, draw_trans_sprite, install_keyboard, keypressed, line, load_bitmap, readkey, screen, set_color_conversion, set_color_depth, set_gfx_mode, set_palette, set_trans_blender, vsync.
See also: BITMAP, END_OF_MAIN, PALETTE, allegro_error, allegro_init, allegro_message, circle, clear_bitmap, clear_keybuf, create_bitmap, destroy_bitmap, draw_lit_sprite, draw_trans_sprite, fixcos, fixsin, fixtoi, font, install_keyboard, install_timer, itofix, keypressed, load_bitmap, makecol, retrace_count, screen, set_color_conversion, set_color_depth, set_gfx_mode, set_trans_blender, vsync.
See also: BITMAP, END_OF_MAIN, allegro_error, allegro_init, allegro_message, clear_keybuf, create_bitmap, destroy_bitmap, draw_trans_sprite, drawing_mode, font, getb, getg, getpixel, getr, install_keyboard, install_mouse, install_timer, keypressed, load_bitmap, makecol, mouse_x, mouse_y, putpixel, rectfill, screen, set_alpha_blender, set_color_conversion, set_color_depth, set_gfx_mode, set_multiply_blender, set_write_alpha_blender, solid_mode.
The basic approach is to select a 15 or 16-bit screen mode, but then draw onto 24-bit memory bitmaps. Since we only need the bottom 5 bits of each 8-bit color in order to store 15-bit data within a 24-bit location, we can fit a light level into the top 3 bits. The tricky bit is that these aren't actually 24-bit images at all: they are implemented as 8-bit memory bitmaps, and we just store the red level in one pixel, green in the next, and blue in the next, making the total image be three times wider than we really wanted. This allows us to use all the normal 256-color graphics routines for drawing onto our memory surfaces, most importantly the lookup table translucency, which can be used to combine the low 5 bits of color and the top 3 bits of light in a single drawing operation. Some trickery is needed to load 24-bit data into this fake 8-bit format, and of course it needs a custom routine to convert the resulting image while copying it across to the hardware screen.
This program chugs slightly on my p133, but not significantly worse than any double buffering in what amounts to a 1920x640, 256-color resolution. The light blending doesn't seem to slow it down too badly, so I think this technique would be quite usable on faster machines and in lower resolution hicolor modes. The biggest problem is that although you keep the full 15-bit color resolution, you only get 3 bits of light, ie. 8 light levels. You can do some nice colored light patches, but smooth gradients aren't going to work too well :-)
See also: BITMAP, COLOR_MAP, END_OF_MAIN, PALETTE, allegro_error, allegro_init, allegro_message, bitmap_color_depth, circlefill, clear_bitmap, clear_keybuf, color_map, create_bitmap_ex, destroy_bitmap, draw_trans_sprite, fixatan2, fixsqrt, fixtoi, getb_depth, getg_depth, getpixel, getr_depth, hsv_to_rgb, install_keyboard, install_mouse, install_timer, itofix, key, keypressed, line, load_bitmap, makecol, mouse_x, mouse_y, poll_mouse, retrace_count, screen, select_palette, set_color_conversion, set_color_depth, set_gfx_mode.
See also: BITMAP, COLOR_MAP, END_OF_MAIN, MATRIX, PALETTE, RGB, RGB_MAP, V3D, allegro_error, allegro_exit, allegro_init, allegro_message, apply_matrix, bitmap_color_depth, bitmap_mask_color, clear_bitmap, clear_to_color, color_map, create_bitmap, desktop_palette, destroy_bitmap, fixed, fixtoi, font, gfx_mode_select_ex, install_keyboard, install_mouse, install_timer, itofix, key, keypressed, line, palette_color, persp_project, polygon_z_normal, quad3d, readkey, rect, retrace_count, rgb_map, screen, set_color_depth, set_gfx_mode, set_palette, set_projection_viewport, set_trans_blender, vsync.
See also: BITMAP, END_OF_MAIN, MATRIX_f, V3D_f, allegro_error, allegro_init, allegro_message, apply_matrix_f, clear_to_color, create_bitmap, desktop_palette, destroy_bitmap, font, get_vector_rotation_matrix_f, install_keyboard, key, key_shifts, makecol, persp_project_f, poll_keyboard, polygon, polygon3d_f, rect, screen, set_clip, set_gfx_mode, set_palette, set_projection_viewport, vsync.
Euler angles are convenient for storing and creating 3D orientations. However, this program demonstrates that they are not good when interpolating between two different orientations. The problem is solved by using Allegro's quaternion operations.
In this program, two cubes are rotated between random orientations. Notice that although they are have the same beginning and ending orientations, they do not follow the same path between orientations.
One cube is being rotated by directly incrementing or decrementing the Euler angles from the starting point to the ending point. This is an intuitive notion, but it is incorrect because it does not cause the object to turn around a single unchanging axis of rotation. The axis of rotation wobbles resulting in the object spinning in strange ways. The object will eventually end up in the orientation that the user intended, but it gets there in a way that is unattractive. Imagine if this method was used to update the position of a camera in a game! Sometimes it would swing wildly and disorient the player.
The other cube is animated using quaternions. This results in a much more pleasing animation because the cube turns around a single axis of rotation.
See also: BITMAP, END_OF_MAIN, MATRIX_f, QUAT, acquire_bitmap, allegro_error, allegro_init, allegro_message, apply_matrix_f, circle, clear_to_color, create_bitmap, desktop_palette, destroy_bitmap, font, get_rotation_matrix, get_rotation_matrix_f, get_rotation_quat, install_keyboard, line, matrix_mul_f, palette_color, persp_project_f, quat_interpolate, quat_to_matrix, readkey, release_bitmap, screen, set_gfx_mode, set_palette, set_projection_viewport, vsync.
See also: BITMAP, END_OF_MAIN, MATRIX, PALETTE, allegro_error, allegro_init, allegro_message, apply_matrix, clear_bitmap, create_bitmap, cross_product, destroy_bitmap, dot_product, fixed, fixmul, fixtof, fixtoi, font, get_rotation_matrix, get_translation_matrix, install_keyboard, install_timer, itofix, key, normalize_vector, palette_color, persp_project, poll_keyboard, putpixel, rectfill, screen, set_gfx_mode, set_palette, set_projection_viewport, triangle, vsync.
See also: BITMAP, END_OF_MAIN, MATRIX_f, PALETTE, V3D_f, allegro_error, allegro_exit, allegro_init, allegro_message, apply_matrix_f, bitmap_color_depth, clear_bitmap, clear_scene, create_bitmap, create_scene, desktop_palette, destroy_bitmap, destroy_scene, font, get_rotation_matrix_f, get_translation_matrix_f, gfx_mode_select_ex, install_int, install_keyboard, install_mouse, install_timer, key, matrix_mul_f, palette_color, persp_project_f, polygon_z_normal_f, render_scene, scene_polygon3d_f, screen, set_color_depth, set_gfx_mode, set_palette, set_projection_viewport.
See also: BITMAP, END_OF_MAIN, MATRIX_f, PALETTE, V3D_f, ZBUFFER, allegro_error, allegro_exit, allegro_init, allegro_message, apply_matrix_f, bitmap_color_depth, clear_bitmap, clear_zbuffer, create_bitmap, create_zbuffer, desktop_palette, destroy_bitmap, destroy_zbuffer, font, gfx_mode_select_ex, install_int, install_keyboard, install_mouse, install_timer, keypressed, palette_color, persp_project_f, polygon_z_normal_f, quad3d_f, readkey, screen, set_color_depth, set_gfx_mode, set_palette, set_projection_viewport, set_zbuffer, vsync.
See also: BITMAP, END_OF_MAIN, RGB, acquire_bitmap, allegro_init, allegro_message, clear_keybuf, create_sub_bitmap, desktop_palette, destroy_bitmap, font, install_keyboard, keypressed, line, rectfill, release_bitmap, screen, scroll_screen, set_color, set_gfx_mode, set_palette, split_modex_screen, vline.
See also: BITMAP, END_OF_MAIN, RGB, _set_color, acquire_bitmap, alert, allegro_error, allegro_init, allegro_message, clear_bitmap, clear_keybuf, create_video_bitmap, desktop_palette, destroy_bitmap, enable_triple_buffer, fixcos, fixed, fixmul, fixsin, fixtoi, font, gfx_capabilities, install_keyboard, install_mouse, install_timer, itofix, keypressed, poll_scroll, release_bitmap, request_video_bitmap, retrace_proc, screen, set_gfx_mode, set_palette, timer_can_simulate_retrace, timer_simulate_retrace, triangle.
This program sets up a 12-bit mode on any 8-bit card, by setting up a 256-colour palette that will fool the eye into grouping two 8-bit pixels into one 12-bit pixel.
It's quite simple (sort of). You make your 256-colour palette with all the combinations of blue and green, assuming green ranges from 0-15 and blue from 0-14. This takes up 16x15=240 colours. This leaves 16 colours to use as red (red ranges from 0-15).
Then you put your green/blue in one pixel, and your red in the pixel next to it. The eye gets fooled into thinking it's all one pixel.
It's all very simple really. Honest.
To start with, you set a normal 256-color VESA mode, and construct a special palette for it. But then comes the trick: you need to write to a set of two adjacent pixels to form a single 12-bit dot. Two eight bit pixels is the same as one 16-bit pixel, so after setting the video mode you need to hack the screen bitmap about, halving the width and changing it to use the 16-bit drawing code. Then, once you have packed a color into the correct format (using the makecol12() function below), any of the normal Allegro drawing functions can be used with this 12-bit display!
Things to note:
The horizontal width is halved, so you get resolutions like 320x480, 400x600, and 512x768.
Because each dot is spread over two actual pixels, the display will be darker than in a normal video mode.
Any bitmap data will obviously need converting to the correct 12 bit format: regular 15 or 16-bit images won't display correctly...
Although this works like a truecolor mode, it is actually using a 256-color palette, so palette fades are still possible!
Note: This code only works in linear screen modes (don't try Mode-X).
See also: BITMAP, END_OF_MAIN, MATRIX, PALETTE, RGB, allegro_error, allegro_init, allegro_message, apply_matrix, circle, clear_bitmap, clear_keybuf, clear_to_color, create_bitmap, create_bitmap_ex, destroy_bitmap, ellipsefill, fade_out, fixcos, fixed, fixsin, fixtoi, font, get_rotation_matrix, getpixel, install_keyboard, itofix, keypressed, line, makecol, putpixel, screen, set_clip, set_color, set_gfx_mode, set_palette, text_height, text_length.
See also: BITMAP, END_OF_MAIN, PALETTE, acquire_bitmap, allegro_error, allegro_init, allegro_message, clear_bitmap, create_video_bitmap, destroy_bitmap, font, gfx_capabilities, install_keyboard, install_timer, keypressed, load_bitmap, readkey, release_bitmap, screen, set_gfx_mode, set_palette, show_video_bitmap.
The technique is to connect the series of guide points p1..p(n) with spline curves from p1-p2, p2-p3, etc. Each spline must pass though both of its guide points, so they must be used as the first and fourth of the spline control points. The fun bit is coming up with sensible values for the second and third spline control points, such that the spline segments will have equal gradients where they meet. I came up with the following solution:
For each guide point p(n), calculate the desired tangent to the curve at that point. I took this to be the vector p(n-1) -> p(n+1), which can easily be calculated with the inverse tangent function, and gives decent looking results. One implication of this is that two dummy guide points are needed at each end of the curve, which are used in the tangent calculations but not connected to the set of splines.
Having got these tangents, it becomes fairly easy to calculate the spline control points. For a spline between guide points p(a) and p(b), the second control point should lie along the positive tangent from p(a), and the third control point should lie along the negative tangent from p(b). How far they are placed along these tangents controls the shape of the curve: I found that applying a 'curviness' scaling factor to the distance between p(a) and p(b) works well.
One thing to note about splines is that the generated points are not all equidistant. Instead they tend to bunch up nearer to the ends of the spline, which means you will need to apply some fudges to get an object to move at a constant speed. On the other hand, in situations where the curve has a noticable change of direction at each guide point, the effect can be quite nice because it makes the object slow down for the curve.
See also: END_OF_MAIN, acquire_screen, alert, allegro_error, allegro_init, allegro_message, calc_spline, circlefill, clear_keybuf, clear_to_color, desktop_palette, fixatan2, fixcos, fixed, fixmul, fixsin, fixsqrt, fixtof, fixtoi, font, ftofix, install_keyboard, install_mouse, install_timer, itofix, key, keypressed, line, makecol, mouse_b, mouse_x, mouse_y, palette_color, poll_mouse, readkey, release_screen, screen, set_gfx_mode, set_palette, show_mouse, spline, vsync, xor_mode.
See also: BITMAP, END_OF_MAIN, PALETTE, acquire_bitmap, allegro_error, allegro_init, allegro_message, bitmap_color_depth, clear_bitmap, create_bitmap, create_system_bitmap, create_video_bitmap, desktop_palette, destroy_bitmap, enable_triple_buffer, fixcos, fixed, fixmul, fixsin, fixtoi, font, ftofix, generate_332_palette, gfx_capabilities, gfx_mode_select_ex, install_int_ex, install_keyboard, install_mouse, install_timer, keypressed, line, makecol, poll_scroll, release_bitmap, request_video_bitmap, screen, set_color_depth, set_gfx_mode, set_palette, show_video_bitmap, triangle, vsync, xor_mode.
Yes, I know the fractal drawing is very slow: that's the point! This is so you can easily check whether it goes on working in the background after you switch away from the app.
See also: BITMAP, END_OF_MAIN, PALETTE, acquire_bitmap, acquire_screen, allegro_error, allegro_exit, allegro_init, allegro_message, bitmap_color_depth, clear_to_color, create_sub_bitmap, desktop_palette, destroy_bitmap, font, get_display_switch_mode, gfx_mode_select_ex, install_int, install_keyboard, install_mouse, install_timer, keypressed, makecol, palette_color, putpixel, readkey, rectfill, release_bitmap, release_screen, screen, set_color_depth, set_display_switch_callback, set_display_switch_mode, set_gfx_mode, set_palette.
See also: END_OF_MAIN, MIDI, allegro_error, allegro_init, allegro_message, destroy_midi, install_sound, install_timer, load_midi, os_multitasking, play_midi, remove_sound.
See also: AUDIOSTREAM, END_OF_MAIN, allegro_error, allegro_init, allegro_message, clear_to_color, desktop_palette, font, free_audio_stream_buffer, get_audio_stream_buffer, install_keyboard, install_sound, install_timer, keypressed, makecol, play_audio_stream, readkey, screen, set_gfx_mode, set_palette, stop_audio_stream, voice_start, voice_stop.