Andres Ruiz Garcia (aruiz++at++espelsa.es)
Tue, 22 Jun 1999 09:30:42 +0200
I have recently requested assistance with the activation of the
asynchronous DBase data upload
process. Mario (Veraart++at++fel.tno.nl) informed me that I would find the
necessary information on the
manual (specifically, on the pfBuffer page). I have followed the
directions therein and the DBase
process gives me an error which I will describe as follows:
When I apply pfPrint in order to go through the tree, the former
only produces
the first item of the Performer tree, i.e., pfscene. The process
dies when it
reaches the first child and my application quits. (pfPrint is
launched from the main
procedure without any trouble but fails at the Dbase procedure)
My program has the following structure:
- Declaration of global variables required in order to generate a
landscape by way of a tiling.
These are pfGroup, pfVec3, ushort, pfVec4, pfVec2, int, etc
I only declare here pointer vectors:
pfGroup **losetas;
pfVec3 **vertices;
pfVec3 **normales;
ushort **cindex;
ushort **Mcindex;
ushort **vindex;
pfVec4 *colores;
pfVec2 *texvertex;
int **lenght;
- Next I declare the variable containing the application data.
It is similar to the ones from the Performer code examples
REPt_SharedState *ViewState;
and contains just a few variables so as not to complicate the
example, namely:
A psScene, a void* and a static struct, with no pointers.
main{
- Performer startup variables:
pfPipe *p;
pfPipeWindow *pw;
pfChannel *chan;
pfEarthSky *eSky;
etc...
pfInit ();
pfMalloc for ViewState: ViewState = (REPt_SharedState *)
pfMalloc (
sizeof (REPt_SharedState),pfGetSharedArena ());
ViewState->arena assignment with pfGetSharedArena();
pfMalloc for the pointer vectors (pointers only!).
pfMultiprocess (PFMP_APPCULLDRAW | PFMP_FORK_DBASE);
pfConfig ();
scene creation: ViewState->scene = pfNewScene ();
Memory allocation to the landscape tiles (variable 'losetas').
losetas[i]=pfNewGroup();
Hook up of the previously created tiles to the scene.
pfAddChild (ViewState->scene, losetas[i]);
Creation of coordinate axes referenced to the example origin and
hook up of the axes to the scene:
pfAddChild(scene,DCS);
Creation of the Performer window, channel, etc.
Creation of a pfSky.
Execution of a scene pfPrint.
pfPrint(ViewState->scene,
PFTRAV_SELF | PFTRAV_DESCEND,
PFPRINT_VB_INFO,
NULL);
I use pfDBaseFunc in order to indicate the Dbase callback.
while(1){
pfSync();
I turn around the scene in order to visualize the objects. At
this point it should
only be able to see the axes at (0,0,0) .
pfFrame();
}
END.
}
What I do with the DBase function is the following:
void UpdateTerrain (void *data){
I display the pid for the new process
printf("DBase:%d\n",getpid());
I execute the scene's pfPrint.
pfPrint(ViewState->scene,
PFTRAV_SELF | PFTRAV_DESCEND,
PFPRINT_VB_INFO,
NULL);
pfDBase();
}
==============================
When I run the program, the information output from the pfPrint
executed
in the parent process is obtained with no trouble. When
UpdateTerrain is
called for the first time, the process dies when trying to access
the scene's
first child, specifically executing pfPrint.
What is the cause of death? The Dbase process doesn't seem to 'see'
some
of the variables: It sees ViewState->scene, but not the rest of the
Performer
tree.
We run Performer 2.1, on a Onyx2 machine.
-- =+=+=+=+=+=+=+=+=+ Andres Ruiz Garcia =+=+=+=+=+=+=+=+=+ aruiz++at++espelsa.es Tlfn: 91 506 23 70/77 =+=+=+=+=+=+=+=+=+
This archive was generated by hypermail 2.0b2 on Tue Jun 22 1999 - 00:44:04 PDT