Mail Archives: djgpp/2000/05/29/02:45:32
Dogansmoobs <dogansmoobsNOdoSPAM AT hotmail DOT com DOT invalid> writes:
> A while ago, I used to use Allegro. It was great, but I spent
> way too much time wondering, how does it do that? So one day, I
> decided to write my own library, right now only for mode 13h.
> It worked great, except for when I tried to pass a pointer to a
> stuct to a function. My bitmap stuce looks something like this:
>
> typedef struct bitmap
> {
> int width;
> int height;
> char *dat;
> } bitmap;
>
> If I pass the whole struct to a function, I can access it
> normally, but when I do it as allegro does, like this:
>
> bitmap *bmp;
> bmp = loadPcxFile("file.pcx");
>
> In the loadPcxFile function, it always crashes on the line:
> bmp->width = width;
>
> and also in any function that tries to access the passed pointer
> to a bitmap, I get a page fault. Is there something really
> obvious that I'm missing here??? If there is, I'd really
> appreciate if you could call me stupid and tell me what I'm
> doing wrong.
Can you post the actual code of loadPcxFile? It probably is simple
but not without knowing what you're doing.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -