delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/11/13:33:49

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>, <cyber_s AT my-dejanews DOT com>
Subject: RE: BitMap Address
Date: Fri, 11 Sep 1998 16:30:22 +0100
Message-ID: <000d01bddd99$176d0f40$664d08c3@arthur>
MIME-Version: 1.0
In-Reply-To: <6t94il$h2i$1@nnrp1.dejanews.com>
Importance: Normal

> Hi all,
>
>   A guy I work with wants me to do the following:
>
> " To optimize the project, I need this: every bitmap will be
> 128x128 pixels.
> I need them to be packed in memory 4 of them in a 64K chunk.  The first
> bitmap in the group will be at a 64K aligned address, so that the 32bit
> pointers will look like this in hex ( xxxx0000 - address of first pixel in
> 1'st bitmap)  (xxxx0010  - address of first pixel in 2'nd bitmap)
>  (xxxx1000
> - address of first pixel in 3'rd bitmap)  (yyyy0000  - address of
> first pixel
> in 4'th bitmap) "
>
> Is this even possible.	The screen will be 640x480x8.  So
> if I read my
> documentation correctly, if we used 16, 24, or 32 bit,	the
> bitmaps will not
> be aligned in memory in the first place. We are using Allegro, but I can't
> find anyway to load a bitmap at a specific address.  So I would
> like to know
> if the above is possible, and if it is, where should I start
> looking.  I an
> clue-less, Thanks

A BITMAP structure contains more than just the raw image data (such as
clipping, and the width and height of the image). You'll need to copy the
raw image data from inside the structure to a memory space reserved using
malloc or similar. The address of the raw image data is your_image->data
(where your_image is the BITMAP structure of your choosing).

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


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