Mail Archives: djgpp/2003/01/08/06:40:41
>In writting a simple bmp loader, I'm having problems with the struct for
>the bmp header. Even with __attribute__((__packed__)) after each item:
..SNIP..
>To load the bmp header, I'm using fread (if that makes any difference).
>And the program is using C, not CPP files (if that also, makes any
>difference.)
>Any help is appreciated. Thanks.
Have a read of the FAQ in the FAQ directory for sections 22.11 and
22.12 as they will help. I use the #pragma pack() as it then works for
C or C++.
BTW Go and have a look at Allegro, http://alleg.sourceforge.net/ as it
has BMP support and when I added BMP support a long long time ago to
one of m,y programs (before allegro came along) the BMP specs from MS
are a bit confusing as there were some tricks. To save you pulling out
your hair have a look at the code in Allegro and remember that Allegro
works on DOS, Windows and Linux so it may make your application more
portable if you use it.
Andrew
- Raw text -