delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/14/13:51:45

From: Robin Burrows <rburrows AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro mode 13h
Date: Wed, 14 Oct 1998 18:43:37 +0100
Organization: Virgin Net Usenet Service
Lines: 29
Message-ID: <3624E2C9.49E2@bigfoot.com>
References: <01bdf794$4a8e4460$5e9bf482 AT s-64584>
NNTP-Posting-Host: 194.168.70.226
Mime-Version: 1.0
X-Mailer: Mozilla 3.01C-VN711-003 (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tarad wrote:
> #include <allegro.h>
> 
> int main(void)
> {
>    allegro_init();
>    set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
should check for error here...
>    install_keyboard();
> 
>    BITMAP *image;
>    PALETTE *pal;
should be PALETTE pal;
>    image = create_bitmap(16, 16);
no need to do this ias load_bitmap gives you a bitmap, you just lost the
pointer
>    image = load_bitmap("test.bmp", pal);
check for error (something like if (image==NULL) error..... )
you'd probably want a set_palette (pal); here
> 
>    blit(image, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
try: blit(image, screen, 0, 0, 0, 0, image->w, image->h);
unless you're sure the image will be bigger than the screen.
> 
>    readkey();
>    allegro_exit();
>    return 0;
> }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019