Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <allegro.h>
- void init();
- void deinit();
- int main() {
- init();
- int r = 10;
- int x =0, y=0;
- while (!key[KEY_ESC]) {
- circlefill(screen, x, y, r, makecol(255, 160 ,0));
- r += 1;
- x += 1;
- y +=1 ;
- _sleep(100);
- }
- deinit();
- return 0;
- }
- END_OF_MAIN()
- void init() {
- int depth, res;
- allegro_init();
- depth = desktop_color_depth();
- if (depth == 0) depth = 32;
- set_color_depth(depth);
- res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
- if (res != 0) {
- allegro_message(allegro_error);
- exit(-1);
- }
- install_timer();
- install_keyboard();
- install_mouse();
- /* add other initializations here */
- }
- void deinit() {
- clear_keybuf();
- /* add other deinitializations here */
- }
Add Comment
Please, Sign In to add comment