void DLM_APIENTRY crDLMSendDLMList(CRDLM *dlm, unsigned long listIdentifier,
	SPUDispatchTable *dispatchTable)
{
    dispatchTable->NewList(listIdentifier, GL_COMPILE);
    crDLMReplayDLMList(dlm, listIdentifier, dispatchTable);
    dispatchTable->EndList();
}
/* Playback/execute a list in the current DLM */
void DLM_APIENTRY crDLMReplayList(unsigned long listIdentifier, SPUDispatchTable *dispatchTable)
{
    CRDLMContextState *listState = CURRENT_STATE();
    if (listState) {
	CRDLMReplayState oldReplayState = listState->replayState;
	listState->replayState = CRDLM_REPLAY_ALL_FUNCTIONS;
	crDLMReplayDLMList(listState->dlm, listIdentifier, dispatchTable);
	listState->replayState = oldReplayState;
    }
}
void
crDLMComputeBoundingBox(unsigned long listId)
{
	static GLboolean tableInitialized = GL_FALSE;
	static SPUDispatchTable t;
	CRDLMContextState *listState = CURRENT_STATE();
	CRDLM *dlm = listState->dlm;
	DLMListInfo *listInfo
		= (DLMListInfo *) crHashtableSearch(dlm->displayLists, listId);

	if (!tableInitialized) {
		InitDispatchTable(&t);
		crStateInitMatrixStack(&ModelViewStack, CR_MAX_MODELVIEW_STACK_DEPTH);
		crStateInitMatrixStack(&DummyStack, CR_MAX_MODELVIEW_STACK_DEPTH);
		tableInitialized = GL_TRUE;
	}

	CurrentStack = &ModelViewStack;

	Xmin = Ymin = Zmin = FLT_MAX;
	Xmax = Ymax = Zmax = -FLT_MAX;
	
	crDLMReplayDLMList(listState->dlm, listId, &t);

	if (Xmin == FLT_MAX) {
		/* XXX review this choice of default bounds */
		/*
		crDebug("Warning: no bounding box!");
		*/
		Xmin = -100;
		Xmax =  100;
		Ymin = -100;
		Ymax =  100;
		Zmin = -100;
		Zmax =  100;
	}
	/*
	crDebug("List %d bbox: %f, %f, %f .. %f, %f, %f", (int) listId,
					Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
	*/

	listInfo->bbox.xmin = Xmin;
	listInfo->bbox.ymin = Ymin;
	listInfo->bbox.zmin = Zmin;
	listInfo->bbox.xmax = Xmax;
	listInfo->bbox.ymax = Ymax;
	listInfo->bbox.zmax = Zmax;
}
Esempio n. 4
0
/* Playback/execute a list in the current DLM */
void DLM_APIENTRY crDLMReplayList(unsigned long listIdentifier, SPUDispatchTable *dispatchTable)
{
    CRDLMContextState *listState = CURRENT_STATE();
    if (listState)
        crDLMReplayDLMList(listState->dlm, listIdentifier, dispatchTable);
}