Click to See Complete Forum and Search --> : [RESOLVED] Allegro simple help


Vlad417
June 9th, 2007, 06:43 PM
i have just started using the allegro library and i'm already confused why my program won't run properly.
IDE:Code::Blocks
Compiler:GNU GCC

#include <allegro.h>
using namespace std;

int main(){
allegro_init();
install_keyboard();
install_timer();
do{
BITMAP *bmp = create_bitmap(800,640);
clear_bitmap(bmp);
int blue = makecol(0,0,256);
putpixel(screen,100,100, blue);
}while(!key[KEY_ESC]);
allegro_exit();
}
END_OF_MAIN();


code is free to edit.

all i want this to do is open a window 800,640 and draw a blue pixel at (100,100). the program compiles and links, put when i open the .exe the concole opens and then windows says "pixels.exe has encountered a problem and needs to close. We are sorry for the inconvenience. blah blah blah" how do i get this baby to run the way i want it? thx.