Tom McReynolds (tomcat++at++proxima)
Thu, 18 Jan 1996 00:31:50 -0800
When pfConfig() is called, (when you're not running with PFMP_APPCULLDRAW)
the pipe processes get forked. At fork time, the variables are
copied. You're correctly creating and setting textures, lights, etc. after
the pfConfig(), but the copied variables in your other processes don't see
the changes you've made.
If this is the problem you're seeing, we have a standard way to avoid it:
1. Declare a structure that contains all the state that needs sharing
2. Define a static pointer to that structure
3. *Allocate* a structure and set the pointer to its address.
4. Now call pfConfig(). The fork will copy the pointer to the structure, so
all the forked processes can see changes made to the variables in the
structure.
5. Go ahead and create and set things, using the variables in the allocated
structure.
It's a bit easier to just look at some code. in the sample directory,
sample/pfguide/libpf/C, take a look at complex.c. The shared structure
is called "SharedData"; the pointer to the structure is called "Shared".
If your problem is something else, let me know...
Good Luck!
-Tom
> From: "Marco Tartaglia" <marco++at++infobyte.it>
> Date: Wed, 17 Jan 1996 14:41:21 +0000
> To: info-performer++at++sgi.sgi.com
> Subject: Project Texture Problem
>
> Hi,
>
> I've a problem with project textures; when i run my program with
> PFMP_APPCULLDRAW it works correctly but it doesn't work with
PFMP_APPCULL_DRAW.
> My configuration is:
> Onyx RE2 with ++at++ RM5
> IRIX 6.2 (or IRIS 5.3)
> Performer 2.0 with DSO
>
> For more information, i give us the outline of my program:
>
> APP process
> {
> ...
> pfInit();
> ...
> pfMultiProcess(..);
> ...
> pfConfig();
> ...
> NewChan, NewScene, Load FLT file
>
> tex = pfNewTex(pfGetSharedArena());
> pfLoadTexFile(tex, "image.inta");
>
> frust = pfNewFrust(pfGetSharedArena());
> pfMakeSimpleFrust(frust, 60.0f);
>
> light = pfNewLSource();
> pfLSourceAttr(light, PFLS_PROJ_TEX, tex);
> pfLSourceAttr(light, PFLS_PROJ_FRUST, frust);
> pfLSourceMode(light, PFLS_PROJTEX_ENABLE, PF_ON);
> ...
>
> while (TRUE)
> {
> pfFrame();
> }
> ...
>
> }
>
> DRAW process
> {
> ...
>
> once time
> {
> lm = pfNewLModel(pfGetSharedArena());
> pfLModelLocal(lm, PF_ON);
> pfApplyLModel(lm);
> }
> ...
>
> }
>
> Thanks
>
> --
> Marco Tartaglia Infobyte
Spa
> VR R&D Software Engineer Via della Camilluccia
67
> E-mail marco++at++infobyte.it 00135
Roma
> Tel +39-6-35572210 Fax
+39-6-35572300
>
>
> ---End of forwarded mail from "Marco Tartaglia" <marco++at++infobyte.it>
>
> --
> -----{-----{---++at++ -----{----{---++at++ -----{----{---++at++ -----{----{---++at++
> Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
> src++at++sgi.com (415) 933 - 1002 FAX: (415) 965 - 2658 MS 8U-590
> -----{-----{---++at++ -----{----{---++at++ -----{----{---++at++ -----{----{---++at++
>-- End of excerpt from Sharon Clay
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:15 PDT