www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/25/04:16:14

From: Spooky <spo_nospam_oky760 AT crosswinds DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: A desperate cry for help. :-)
Date: Fri, 24 Dec 1999 00:33:26 -0800
X-Posted-Path-Was: not-for-mail
X-Accept-Language: en,pdf
X-ELN-Date: 24 Dec 1999 08:31:42 GMT
X-ELN-Insert-Date: Fri Dec 24 01:45:02 1999
Organization: EarthLink Network, Inc.
Lines: 57
Mime-Version: 1.0
NNTP-Posting-Host: 1cust79.tnt1.ridgecrest.ca.da.uu.net
Message-ID: <38632FD5.94811A78@crosswinds.net>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Here is the story.  I have used allegro a little in the past and now I
am trying to get the feel for it again.  While putting together a little
mouse test program (to teach myself) I ran into a snag early on.  Before
I even got to the mouse part I wanted to put up a background.  So
reverse engineering from example code this is what I have.  (FYI the
back.bmp is 500x400 256co)  When I run it I get a general fault, a bunch
of hex stuff and 2 call fram traceback eip's   0x00003870 and 0x0002c2a2

I know this isn't THAT difficult I just wonder what I am missing, any
help would be greatly appreciated.

--------------------------CODE BELOW--------as if you couldn't guess
#include <stdlib.h>
#include <stdio.h>
#include <allegro.h>
/* This is the first mouse program...hopefully load a bitmap on the
screen and when certain parts are toggled it will do different things*/
int main()
{
   BITMAP *back;
   PALLETE pal;
    clear(back);
   allegro_init();
   install_keyboard();
   install_timer();
   set_gfx_mode(GFX_VGA, 320, 240, 0, 0);
   back=load_bitmap("back.bmp",pal);
   if (!back) {
     printf("Error reading bitmap file ");
    return 1;
   }
   set_pallete(pal);
   blit(back, screen, 0, 0,(SCREEN_W-back->w)/2,
       (SCREEN_H-back->h)/2, back->w, back->h);
   destroy_bitmap(back);
   readkey();
   return 0;
}

--
**************************************************************
None of the ideas expressed above are actually mine. They are
told to me by Luthor and Ferdinand, the five inch tall space
aliens who live under my desk. In return for these ideas, I
have given them permission to eat any dust bunnies they may
find under there.

This message never happened.
____________________________________________________________
If you would like to contact me, try the following:
ICQ.....................41827703
WEB.................... www.spooky.ca.tc
YAHOO PAGER.............spooky661
See my web page for other communication options
**************************************************************



- Raw text -


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