Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/06/2012, 18:26
Mathip
 
Fecha de Ingreso: octubre-2009
Mensajes: 83
Antigüedad: 14 años, 7 meses
Puntos: 1
Pregunta allegro basico problema

hola estoy intentando aprender a usar esta libreria, tengo el siguiente codigo:

Código:
#include <allegro.h>
#include <conio.h>
#include <stdio.h>

void init();
void deinit();

int main() {
	init();
     BITMAP *buffer;
     clear_to_color(buffer, 0x000000);

     
     
   
	while (!key[KEY_ESC]) {
		/* put your code here */
           
           textout_ex(buffer,font,"HOLA",160, 25, 0xFFFFFF, 0x000000);
           blit(buffer, screen, 0, 0, 0, 0, 320, 240);
           

	}
     destroy_bitmap(buffer);
	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 */
}
lo compilo no tira errores, pero cuando lo intento ejecutar me sale un mensaje "el programa ah dejado de funcionar" cerrar el programa...

uso dev c++ y windows 7 a ver si alquien me puede dar una mano desde ya gracias