delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/28/22:12:02

Message-Id: <3.0.32.19970528211007.009146c0@dataplusnet.com>
Date: Wed, 28 May 1997 21:10:11 -0500
To: djgpp AT delorie DOT com
From: "Michael M." <michaelm AT dataplusnet DOT com>
Subject: Problems With Displaying Graphics
Mime-Version: 1.0

--=====================_864889811==_
Content-Type: text/plain; charset="us-ascii"

I am new to programming and DJGPP.  I am starting simple and if this works,
I will build on it.  

I am having problems displaying a graphic with the Allegro 2.2 library.
Whenever I try to run this, it just shows a blank, black screen; or
sometimes it has a SIGSEGV error.  I compile it with the command line:

gcc game.c -o game.exe -lalleg

Then I run it with:

game 0001.pcx

Any suggestions about what could be wrong?  Is there something stupid I am
doing that is the reason it doesn't work?

Thanks,
Michael Matczynski
michaelm AT dataplusnet DOT com



Code:
///////////////////////game.c//////////////////////////
#include <stdlib.h>
#include <stdio.h>

#include "allegro.h"

void main(int argc, char *argv[])
{
   BITMAP *buffer;
   PALLETE the_pallete;

   start_up();			// Initilizes Allegro,keyboard,timer,mouse
   display_copyright();		// Displays my name
   
   set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);     // SVGA mode
   
   buffer = create_bitmap(50,50);	// Creates a 50 by 50 bitmap
   clear(buffer);			// Clears newly made bitmap
   buffer = load_bitmap(argv[1], the_pallete);	//loads the file into buffer
   set_pallete(the_pallete);
   
   blit(buffer, screen, 0, 0, 5, 5, 640, 480);	//Blits buffer to screen
   
   readkey();
   destroy_bitmap(buffer);
   exit(0);
}

--=====================_864889811==_
Content-Type: application/octet-stream; name="0001.pcx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="0001.pcx"

CgUBCAAAAAAxADEASABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAADMgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAA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v9pJTPL/8HIXMf/wchc
yf9+Q0/I/8HzQ8Hzwv9+Q0/L/8HQcsf/wdByyf/BwaWryP/B+aXB+cL/wcGlq8v/wei8x//B6LzG
/8P/u8IlwdbH/61pw/+7wiXB1sr/wchcx//ByFzJ/8HEwkPB3Mf/uH7D/8HEwkPB3Mr/wdByx//B
0HLJ/8HjwqXB7sf/wd3BwcP/wePCpcHuyv/B6LzH/8HovMb/xP93JWnE/8HxksH/aa3E/3clacT/
wfGSxP/ByFzH/8HIXMr/ikN+xP/B86HB/364xP+KQ37E/8HzocT/wdByx//B0HLK/8HHpcHBxP/B
+cHSwf/BwcHdxP/Bx6XBwcT/wfnB0sT/wei8x//B6LzG/8X/n0Bpu8HIwpLC8SXB8cX/n0Bpu8HI
wpLB8dr/rFt+wcTB0MKhwvNDwfPF/6xbfsHEwdDCocHz2v/B17DBwcHjwejC0sL5pcH5xf/B17DB
wcHjwejC0sH51f/H/8HWwsjD/8HxwdbI/8HWwsjf/8HcwtDD/8HzwdzI/8HcwtDf/8HuwujD/8H5
we7I/8HuwujY///////Y///////Y///////Y///////Y///////Y///////Y///////Y///////Y
///////Y///////Y///////Y///////Y///////Y///////Y///////Y///////Y///////Y////
///Y///////Y///////Y///////Y/w==
--=====================_864889811==_--

- Raw text -


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