Martin Suter (suter++at++geo.unizh.ch)
Mon, 26 May 1997 14:42:05 +0200 (MET DST)
Using the 'DBASE'-example in the reference pages I've managed to
set up a basic database paging. It works fine when loading 'pfGroup's
and adding them to the scene. As soon as I add 'pfLOD' nodes it crashes.
Is there anywhere some example code on how to correctly use 'pfLOD's
in the DBASE process?
The (working) code using 'pfGroup's is:
--------------------------------------
//*** Global Variables
TileData *tileData;
pfGroup **tiles;
main(int argc, char *argv[])
{
.
.
.
pfInit();
InitSharedMem(argc, argv);
InitConfig();
tiles = (pfGroup **) pfMalloc(sizeof(pfGroup*) * NUMTILES,
pfGetSharedArena());
tileData = (TileData *) pfMalloc(sizeof(TileData) * NUMTILES,
pfGetSharedArena());
pfMultiprocess(PFMP_APP_CULL_DRAW | PFMP_FORK_DBASE);
pfConfig();
.
.
.
pfDBaseFunc(pageDBase);
while (!SimDone())
{
.
.
upDateTileStatus(tileData);
pfFrame();
.
}
}
void pageDBase(void *data)
{
static pfBuffer *buf = NULL;
if ("time to load") {
if (buf == NULL) {
buf = new pfBuffer;
buf->select();
}
for(i=0; i<NUMTILES; i++) {
if (tileData[i].tileStatus == 1) {
if (tiles[i] != NULL) {
/* ViewState->sceneGroup is root of all loaded files (perfly-code)*/
ViewState->sceneGroup->bufferRemoveChild(tiles[i]);
pfAsyncDelete(tiles[i]);
}
tiles[i] = (pfGroup*)readTile(i);
ViewState->sceneGroup->bufferAddChild(tiles[i]);
}
}
pfBuffer::merge();
}
pfDBase();
}
void upDateTileStatus(TileData* tileData)
{
.
.
/* set 'tileData[i].tileStatus' to 0 (do not load) or 1 (do load)
and determine if it's "time to load" */
.
.
}
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Martin Suter Remote Sensing Laboratories
Research Associate University of Zurich
Email:suter++at++geo.unizh.ch Winterthurerstrasse 190
Phone:+41 - 1 / 257 51 63 CH-8057 Zurich; Switzerland
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:18 PDT