Beginning of the program
Program begins in Listing 1.
Listing 1. Beginning of the program named PutPixel02.
#include <allegro.h>
int main(){
allegro_init();//Allegro initialization
install_keyboard();//Set up for keyboard input
//Need to set the color depth before setting the
// graphics mode.
set_color_depth(32);
//Set the graphics mode to a 256x256-pixel window.
set_gfx_mode(GFX_AUTODETECT_WINDOWED,256,256,0,0);
|
The code in Listing 1 is essentially the same as the code that I explained in the previous and earlier lessons, so no further explanation of Figure 1 should be necessary.