PDA

View Full Version : help with bitmaps



jono_123
04-22-2002, 07:48 PM
hi there
is there any easy way to load bitmaps without using glaux(cuz its not working and i dunno why)?
thanx
jono http://www.opengl.org/discussion_boards/ubb/smile.gif

rts
04-22-2002, 08:33 PM
Off the top of my head...




FILE *f;
struct stat s;
void *m;

stat(filename, &s);
m = malloc(s.st_size);
f = fopen(filename, "r");
fread(m, s.st_size, 1, f);


works with any sort of file too, not just bitmaps.

Azdo
04-22-2002, 11:12 PM
Search for .BMP file format on
www.wotsit.org (http://www.wotsit.org)

It will be an easy task to code a function that loads the bitmap into memory.