exsprite(3alleg4)


NAME

   exsprite   -  Datafiles  access  and  sprite  animation.  Allegro  game
   programming library.

SYNOPSIS

   #include <allegro.h>

   Example exsprite

DESCRIPTION

   This example demonstrates how to use datafiles, various sprite  drawing
   routines and flicker-free animation.

   Why  is the animate() routine coded 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.   Drawing sprite on the screen (meaning in
   VRAM) and then clearing a background for it  is  not  very  fast.  This
   example uses a different method which is much faster, but require a bit
   more memory.

   First the buffer is cleared (it's a normal BITMAP), then the sprite  is
   drawn  on  it,  and  when the drawing is finished this buffer is copied
   directly to the screen. So the end result is that  there  is  a  single
   VRAM  blit  instead  of  blitting/clearing the background and drawing a
   sprite on it.  It's a good method even when you  have  to  restore  the
   background. And of course, it completely removes any 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.

   Note  that  on  modern  systems,  the above isn't true anymore, and you
   usually get the best performance by  caching  all  your  animations  in
   video  ram  and  doing  only  VRAM->VRAM  blits,  so  there  is no more
   RAM->VRAM transfer at all anymore. And usually, such transfers can  run
   in parallel on the graphics card's processor as well, costing virtually
   no main cpu time at all.  See the exaccel example  for  an  example  of
   this.

SEE ALSO

   BITMAP(3alleg4),      DATAFILE(3alleg4),      END_OF_FUNCTION(3alleg4),
   END_OF_MAIN(3alleg4),  LOCK_FUNCTION(3alleg4),  LOCK_VARIABLE(3alleg4),
   SCREEN_H(3alleg4),      SCREEN_W(3alleg4),      allegro_error(3alleg4),
   allegro_init(3alleg4),     allegro_message(3alleg4),     blit(3alleg4),
   circle(3alleg4),      clear_bitmap(3alleg4),     clear_keybuf(3alleg4),
   create_bitmap(3alleg4), destroy_bitmap(3alleg4),  draw_sprite(3alleg4),
   draw_sprite_h_flip(3alleg4),               draw_sprite_v_flip(3alleg4),
   draw_sprite_vh_flip(3alleg4),      fixed(3alleg4),       font(3alleg4),
   hline(3alleg4),   install_int_ex(3alleg4),   install_keyboard(3alleg4),
   install_sound(3alleg4),    install_timer(3alleg4),     itofix(3alleg4),
   key(3alleg4),        keypressed(3alleg4),       load_datafile(3alleg4),
   makecol(3alleg4),    palette_color(3alleg4),     pivot_sprite(3alleg4),
   pivot_sprite_v_flip(3alleg4),  play_sample(3alleg4), rectfill(3alleg4),
   replace_filename(3alleg4),       rest(3alleg4),        screen(3alleg4),
   set_gfx_mode(3alleg4),    set_palette(3alleg4),   text_height(3alleg4),
   textout_centre_ex(3alleg4), unload_datafile(3alleg4), vsync(3alleg4)





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.