Mail Archives: djgpp/1997/12/30/15:15:37
Allegro tends to be very popular with DJGPP programmers. To display a .BMP file,
for example, just type:
#include <allegro.h>
#include <conio.h>
main()
{
BITMAP *bmp;
PALETTE pal; // doesn't matter if spelled wrong
allegro_init();
bmp = load_bitmap("image.bmp", pal);
if (!bmp) // did not load
return 1;
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
set_palette(pal);
draw_sprite(screen, bmp, 0, 0);
getch();
allegro_exit();
}
Displays image "image.bmp" on the screen using resolution 640x480 and the
pictures own natural 256 colour bitmap (deithered if necessary).
--
"DeHackEd"
Remove "nospam." from my email address to reply.
It's too late to run when you hear the boom.
Korenschi Francisc Eduard wrote in message
<199712301340 DOT PAA23345 AT tag DOT starnets DOT ro>...
> Hello from Romania,
>
> Could anyone tell me where can I find some sources for diplaying various
>Graphic format and playing different sort of sounds ?
>
> Thanx anticipated for bothering
- Raw text -