Q
Quentin Pope
--
"If a tree falls over in the forest, ##
and there's nobody there to hear it, ###----------------;
do the other trees all laugh at it?" ### 8 - ( ;
~~~~~~~~~~~~~~~~~~~~~~~~~ ###----------------;void
Hello all,
I'm learning about programing graphics in c on the PC at the
moment,
this function is supposed to allocate memory to put a background picture
into, but it never allocates the memory. Could anyone suggest anything
which might fix the problem. I don't know a great deal about allocating
memory etc, but I'm using the medium memory model. Is the fact that I'm
trying to allocate more than 64k the problem - if it is, how can I fix
it? (or if anyone does know graphics, perhaps an alternative way of
doing this entirely would be better?)
PCX_Init(pcx_picture_ptr image)
{
/* This function allocates the buffer region needed to load a
PCX file.
the SCREEN_WIDTH is 320 and SCREEN_HEIGHT is 200
(I've defined
that.*/
if (!(image->buffer = (char far *)malloc(SCREEN-WIDTH *
SCREENJEIGHT +
1)
{
printf("\ncouldn't allocate screen buffer");
exit(7);
}
}
regards,
Quentin
"If a tree falls over in the forest, ##
and there's nobody there to hear it, ###----------------;
do the other trees all laugh at it?" ### 8 - ( ;
~~~~~~~~~~~~~~~~~~~~~~~~~ ###----------------;void
Hello all,
I'm learning about programing graphics in c on the PC at the
moment,
this function is supposed to allocate memory to put a background picture
into, but it never allocates the memory. Could anyone suggest anything
which might fix the problem. I don't know a great deal about allocating
memory etc, but I'm using the medium memory model. Is the fact that I'm
trying to allocate more than 64k the problem - if it is, how can I fix
it? (or if anyone does know graphics, perhaps an alternative way of
doing this entirely would be better?)
PCX_Init(pcx_picture_ptr image)
{
/* This function allocates the buffer region needed to load a
PCX file.
the SCREEN_WIDTH is 320 and SCREEN_HEIGHT is 200
(I've defined
that.*/
if (!(image->buffer = (char far *)malloc(SCREEN-WIDTH *
SCREENJEIGHT +
1)
{
printf("\ncouldn't allocate screen buffer");
exit(7);
}
}
regards,
Quentin