pfGetTexImage woes

New Message Reply Date view Thread view Subject view Author view

From: Desmond Rivet (rivet++at++ecf.utoronto.ca)
Date: 02/05/2001 13:40:23


Hi all,

How exactly does one use pfGetTexImage? I tried to write a VERY SIMPLE AND
SMALL program:

#include <Performer/pf.h>
#include <Performer/pfdu.h>

int main(int argc, char *argv[])
{
    int j, comp, sx, sy, sz;
    unsigned int* image;
    pfTexture *tex;
    
    pfInit();
  
    tex = pfNewTex(pfGetSharedArena());
    
    pfLoadTexFile(tex, "road.pfi");
    pfGetTexImage(tex, &image, &comp, &sx, &sy, &sz);
 
    printf("comp=%d, sx=%d, sy=%d, sz=%d\n", comp, sx, sy, sz);
    for(j = 0; j < sx*sy; j++)
    {
        printf("%d\n",image[j]);
    }
    
    return 0;
}

road.pfi is a proper pfi file (it is a texture in the standard Performer
town demo) and is located in the same directory as the program itself.

The output is:

comp=3, sx=512, sy=64, sz=1
1261846347
1061893695
910116915
1311982929
.....

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?

Thanks for your time...

----------------------------------------------
Desmond Rivet rivet++at++ecf.utoronto.ca
Eng Sci 0T0 + PEY rivet_d++at++hotmail.com

   You live and learn, or you don't live long


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Feb 05 2001 - 13:40:35 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.