Liem Lu (LLU++at++FALCON.AL.WPAFB.AF.MIL)
Thu, 17 Apr 1997 17:41:14 -0400
Could someone tell me what I'm doing wrong with my
database paging in the following code:
If I load tile2.flt in the pageDBase() function, I
won't see it any thing in the scene after merging.
void *arena = NULL;
pfScene **scene;
pfGroup **root1,**root2;
pfSwitch **switch1,**switch2;
void pageDBase(void *data);
int main()
{
.
.
pfInit();
arena = pfGetSharedArena();
scene = (pfScene **) pfMalloc(sizeof(pfScene
*), arena);
root1 = (pfGroup **) pfMalloc(sizeof(pfGroup
*), arena);
root2 = (pfGroup **) pfMalloc(sizeof(pfGroup
*), arena);
switch1 = (pfSwitch **)
pfMalloc(sizeof(pfSwitch *), arena);
switch2 = (pfSwitch **)
pfMalloc(sizeof(pfSwitch *), arena);
pfMultiprocess(PFMP_APP_CULL_DRAW |
PFMP_FORK_DBASE);
pfConfig();
*scene = pfNewScene();
*switch1 = pfNewSwitch();
if ((*root1 =
(pfGroup*)pfdLoadFile("tile1.flt")) == NULL)
{
printf("Unable to load tile1.flt.\n");
pfExit();
exit(-1);
}
pfAddChild(*scene, *switch1);
pfAddChild(*switch1, *root1);
.
.
.
pfDBaseFunc(pageDBase);
while (1)
{
pfSync();
pfFrame();
}
pfExit();
return 0;
}
void pageDBase(void *data)
{
static pfBuffer *buf = NULL;
if (time_to_switch)
{
if (buf == NULL)
{
buf = pfNewBuffer();
pfSelectBuffer(buf);
}
pfBufferRemoveChild(*switch1, *root1);
pfBufferRemoveChild(*scene, *switch1);
pfAsyncDelete(*switch1);
if ((*root2 =
(pfGroup*)pfdLoadFile("tile2.flt")) == NULL)
{
printf("Unable to load tile2.flt.\n");
pfExit();
exit(-1);
}
*switch2 = pfNewSwitch();
pfBufferAddChild(*switch2, *root2);
pfBufferAddChild(*scene, *switch2);
pfMergeBuffer();
}
pfDBase();
}
If I load tile2.flt right after loading tile1.flt
in main() then it works. But that defeats the
purpose of database paging, doesn't it?
Thanks for any help.
Liem Lu
P.O. Box 317258
Logicon Technical Services Inc.
Dayton, Ohio 45437-7258 U.S.A
=======================================================================
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:05 PDT