1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <allegro.h>
#inlcude "Setup.h"
int main(){//Rule of thumb, make main() as small as possible
Startup startup;
BITMAP *buffer = create_bitmap(640, 480);//For double buffering
//Main game loop
while (!key[KEY_ESC]){//Make sure esc is not being hit
rectfill(buffer, 0 , 0, 640, 480, makecol(255, 0, 0));//Red rectangle
blit(buffer, screen, 0, 0, 0, 0, 640, 480);//Draw red recangle in buffer
clear_bitmap(buffer);
}
destroy_bitmap(buffer);//Clear RAM!!!
return 0;
}
END_OF_MAIN();
|