From: Don Burns (don_burns++at++peru.engr.sgi.com)
Date: 02/05/2001 15:40:54
On Feb 5, 4:40pm, Desmond Rivet wrote:
> Subject: pfGetTexImage woes
...
> The program SEG FAULTS, at some point when outputing the array, though for
> the life of me I can't figure out why.
>
> Am I using the functions properly?
Even though the man page calls for a uint ** to be passed as the second
argument, the data is probably stored in uchar format. Change your program to
look like this and it should work ok:
unsigned char *imgptr;
pfLoadTexFile(tex, "road.pfi");
pfGetTexImage(tex, &image, &comp, &sx, &sy, &sz);
imgptr = (unsigned char *)image;
printf("comp=%d, sx=%d, sy=%d, sz=%d\n", comp, sx, sy, sz);
for(j = 0; j < sx*sy; j++)
{
printf("%d\n",imgptr[j]);
}
-don
This archive was generated by hypermail 2b29 : Mon Feb 05 2001 - 15:40:58 PST