Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Circulos En Allegro

DZone's Guide to

Circulos En Allegro

·
Free Resource
Un codigo para dibujar un circulo en allegro con degradado


#include 
  
   

void init();
void deinit();

int main() {
	int cont;
    
    init();
	
	
	for (cont=0;cont<255;cont++){
        circlefill(screen,320,240,255-cont,makecol(cont,0,0));
    }

	while (!key[KEY_ESC]) {
		/* put your code here */
	}

	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 */
}

  
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}