[info-performer] using alternate pfdShare to avoid state sharing

Date view Thread view Subject view Author view

From: Alex Hill (alex.hill++at++sbcglobal.net)
Date: 03/17/2005 10:18:25


I am trying to use pfdLoadFile to load models.
I would like to be able to turn on and off the sharing
of attributes such as pfMaterial. I understand that I
can accumulate all of the relevant mode switches for
each individual loader and set them. However, I would
prefer a more general approach. I have attempted to
stop the sharing by replacing the global and builder
pfdShare structures with a clean one. Then, when
sharing is desired, I reset the global and builder
pdfShare structures. Unfortunately, I still find that
some pfMaterials are still being shared (i.e. with
*.obj files). Can anyone suggest what I am missing?
I also get a segmentation fault when I try to delete
the new pfdShare structure I have created.

pfGroup* obj;
pfdShare* globalShare = pfdGetGlobalShare();
pfdShare* bldrShare = pfdGetBldrShare();
pfdShare* cleanShare = pfdNewShare();
pfdSetGlobalShare(cleanShare);
pfdSetBldrShare(cleanShare);
obj = pfdLoadFile(file.c_str());
pfdSetBldrShare(bldrShare);
pfdSetGlobalShare(globalShare);
pfdCleanShare(cleanShare);
pfdDelShare(cleanShare,0);


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Mar 17 2005 - 10:18:32 PST