pfMPImageCache question

New Message Reply Date view Thread view Subject view Author view

Peter Chou (peter++at++galaxy.cambridge.com)
Fri, 19 Jul 1996 09:55:02 -0400


Hi all,

I got problems in using pfMPImageCache.

I can get pfImageCache to roam a texture window through a large
virtual texture. However, when I tried to use pfMPImageCache,
the texture would not move. Could someone help me figure out
what I have done wrong?

The machine I am using is IMPACT with one IP22 Processor and
High-AA Impact/TRAM Graphics board, and is installed with IRIX 6.2,
Performer 2.1. /usr/gfx/gfxinfo gives:

Graphics board 0 is "IMPACT" graphics.
        Managed (":0.0") 1280x1024
        Product ID 0x0, 2 GEs, 1 RE, 4 TRAMs
        MGRAS revision 2, RA revision 5
        HQ rev A, GE11 rev A, RE4 rev A, PP1 rev A,
        VC3 rev A, CMAP rev D, MC rev C
        19" monitor (id 0x1)

The following is the skectch of my code. When I compiled with
MP_IMAGECACHE not defined, the texture was roaming; but when I
defined MP_IMAGECACHE, the texture would not get updated.
Any code not shown in the following sketch does not depend on
MP_IMAGECACHE flag. I can post the complete test code if that
will help. Thanks in advance.

void DrawCallBack(pfChannel *chan, void *data)
{
pfClearChan(chan);
pfDraw();

#ifdef MP_IMAGECACHE
#else
thisicData = (ICACHE_DATA *)pfGetCurCBufferData(shared->icData);
pfImageCacheOrigin(shared->icache,
      thisicData->cacheS, thisicData->cacheT, 0);
pfImageCacheValidRegionOrigin(shared->icache,
      thisicData->originS, thisicData->originT, 0);
pfApplyImageCache(shared->icache);

pfGetImageCacheValidRegionOffset(shared->icache,&offS,&offT,&offR);
pfGetImageCacheValidRegionSize(shared->icache,&tSizeS,&tSizeT,&tSizeR);
glMatrixMode(GL_TEXTURE);
pfMakeTransMat(tmat,
   offS/(float)tSizeS, offT/(float)tSizeT, offR/(float)tSizeR);
pfLoadMatrix(tmat);
glMatrixMode(GL_MODELVIEW);
#endif

ProcessXEvents();
}

main()
{
pfInit();

pfMultiprocess(PFMP_APP_CULL_DRAW);

pfConfig();

CreatePipeAndWindow();

CreateChannel();

tex = pfNewTex(pfArena);
pfTexFilter(tex, PFTEX_MINFILTER, PFTEX_BILINEAR);

#ifdef MP_IMAGECACHE
   mpicache = pfdLoadMPImageCache(argv[FILENAME_ARG], tex, 0);
   pfAddMPImageCache(pfGetPipe(0), mpicache);
   pfPipeIncrementalStateChanNum(pfGetPipe(0),1);
   icache = pfGetMPImageCacheImageCache(mpicache);
#else
   icache = pfdLoadImageCache(argv[FILENAME_ARG], tex, 0);
   shared->icache = icache;
#endif

pfImageCacheMaxUpdateSize(icache, maxLoadSize, maxLoadSize, 1);

CreateGState(); /* with tex and tev */

CreateGSet(); /* set up a square with above gstate */

while (goOn)
   {
   pfSync();
   pfChanView(chan, view.xyz, view.hpr);
   pfFrame();

   CalculateImageCacheOrigin(&cacheS,&cacheT,&originS,&originT);

#ifdef MP_IMAGECACHE
   pfMPImageCacheOrigin(mpicache, cacheS, cacheT, 0);
   pfMPImageCacheValidRegionOrigin(mpicache, originS, originT, 0);
#else
   thisicData = (ICACHE_DATA *)pfGetCurCBufferData(shared->icData);
   thisicData->originS = originS;
   thisicData->originT = originT;
   thisicData->cacheS = cacheS;
   thisicData->cacheT = cacheT;
   pfCBufferChanged(shared->icData);
#endif
   }
pfExit();
} /* main() */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Peter T. C. Chou
  Cambridge Research Associates, Inc. office: (703)790-0505 ext 7206
  1430 Spring Hill Road, Suite 200 FAX: (703)790-0370
  McLean, VA 22102 E-MAIL: peter++at++cambridge.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:12 PDT

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