Mail Archives: djgpp/1997/08/18/23:48:39
"Filipe Marques de Almeida" <liquidk AT thepentagon DOT com> writes:
> sorry for the dumb question but i am kind of new to djgpp and allegro
It's not a dumb question, especially compared to another question I just
saw... }:)
> is there a problem of using something like this for memory bitmaps
>
> BITMAP *bitmap;
> unsigned char *map;
>
> map = bitmap->line[0];
>
> and then using map for accessing in a linear way.
>
> my question is:
> are the memory bitmaps always one chunk (like graph mode 0x13) or is there
> the danger of the bitmaps getting fragmented
Generally one chunk but not always.
Memory bitmaps (What you make with create_bitmap) will always AFAIK be a
single contiguous chunk. Screen bitmaps will depend on what mode you are
in. The standard VGA modes will be linear, AFAIK. Banked modes --
generally, any screen-size so big that you need SVGA to display it --
are not linear.
Shawn already provided some support for what you want. This function
will tell you what you want to know:
[From allegro.txt]
int is_linear_bitmap(BITMAP *bmp);
Returns TRUE if bmp is a linear bitmap, ie. a memory bitmap, mode 13h
screen, or SVGA screen. Linear bitmaps can be used with the _putpixel(),
_getpixel(), bmp_write_line(), and bmp_read_line() functions.
[End inclusion from allegro.txt]
Tom
- Raw text -