Mail Archives: djgpp/1999/09/07/23:50:18
From: | "Damian Yerrick" <die DOT spammers AT pineight DOT 8m DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: help me; Getting Started with Allegro
|
Date: | Tue, 7 Sep 1999 21:23:49 -0500
|
Organization: | Rose-Hulman Institute of Technology
|
Lines: | 74
|
Message-ID: | <7r4hfk$6hr$1@solomon.cs.rose-hulman.edu>
|
References: | <000801bef92f$8a0dec60$2f4c883e AT ianscomputer>
|
NNTP-Posting-Host: | yerricde.laptop.rose-hulman.edu
|
X-Trace: | solomon.cs.rose-hulman.edu 936757556 6715 137.112.205.146 (8 Sep 1999 02:25:56 GMT)
|
X-Complaints-To: | news AT cs DOT rose-hulman DOT edu
|
NNTP-Posting-Date: | 8 Sep 1999 02:25:56 GMT
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
ian davey <ian12davey AT davey12 DOT freeserve DOT co DOT uk> wrote in message
news:000801bef92f$8a0dec60$2f4c883e AT ianscomputer...
> i am trying to make a basic game using djgpp
> but i have never used it before. i have installed
> it but am stuck. what should i do next?
e. e. cummings fan?
This is how I got started with
1. After you've made Hello World with DJGPP (read
the FAQs and docs), try getting Allegro from
http://www.talula.demon.co.uk/allegro/
and installing it.
2. Rewrite your hello to use the Allegro library in the
VGA graphics mode; then try other graphics primitives.
3. Draw a bitmap in M$ Paint or whatever paint program you're
comfortable with; then save it as a 256 color bitmap and load it
in with this code. Once you have it working, play around with it:
>8 apply scissors
/* readbmp.c */
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
int main(void)
{
PALETTE pal;
BITMAP *bmp;
allegro_init();
install_keyboard();
if(set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) < 0)
{
puts("couldn't set 320x200 graphics on this card; are you using a VGA or
better?");
return 1;
}
bmp = load_bitmap("foo.bmp", pal);
if(bmp != NULL)
{
set_palette(pal);
blit(bmp, screen, 0, 0, 0, 0, bmp->w, bmp->h);
destroy_bitmap(bmp);
}
else
{
textout(screen, font, "couldn't find foo.bmp", 0, 0, 15);
}
readkey();
allegro_exit();
return 0;
}
/* end */
>8 apply scissors
4. Read through allegro.txt, skipping any sections that
completely confuse you.
5. Download DOSArena from Damian Yerrick's home
page. It contains an example of how to write and draw
a complete game suite with Allegro.
Damian Yerrick
http://come.to/yerrick
- Raw text -