Archive for the ‘Allegro’ Category

We will learn how to use the double buffering technique to make things look smooth.
Here is how buffering works:
If you just draw everything to the screen, you will notice that you get a lot of flicker. This is because you are drawing directly to the screen, which is updated by the operating system at an unknown rate! Buffering gets rid of flicker because it minimizes direct drawing to the screen. If you draw each component onto the ‘buffer’, and then the complete screen sized buffer to the screen: flicker is eliminated since you draw everything at once in one pass. It’s that simple. You will also notice, in the unbuffered mode, that the ball will zoom across the screen (if you have a relatively fast computer). Even in buffered mode, things can move pretty fast (or slow – again depending on the speed of your computer). This problem is fixed using timers, which will be explained in the next lesson, so don’t worry about this for now.


Allegro is a game programming library for C/C++ developers distributed freely, supporting the following platforms: DOS, Unix (Linux, FreeBSD, Irix, Solaris, Darwin), Windows, QNX, BeOS and MacOS X. It provides many functions for graphics, sounds, player input (keyboard, mouse and joystick) and timers. It also provides fixed and floating point mathematical functions, 3d functions, file management functions, compressed datafile and a GUI.

Related Website:

Allegro Guide: