exsprite(3)

NAME
exsprite

SYNOPSIS
#include <allegro.h>

Example exsprite

DESCRIPTION
This example demonstrates how to use datafiles, various sprite drawing routines and flicker-free animation. 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(3), DATAFILE(3), END_OF_MAIN(3), allegro_error(3), allegro_init(3), allegro_message(3), clear_bitmap(3), clear_keybuf(3), create_bitmap(3), destroy_bitmap(3), draw_sprite(3), draw_sprite_h_flip(3), draw_sprite_v_flip(3), draw_sprite_vh_flip(3), fixed(3), font(3), install_keyboard(3), itofix(3), key(3), keypressed(3), load_datafile(3), palette_color(3), rectfill(3), rotate_sprite(3), rotate_sprite_v_flip(3), screen(3), set_color_conversion(3), set_gfx_mode(3), set_palette(3), unload_datafile(3), vsync(3)