Exemplo n.º 1
0
/**
*  @brief
*    Constructor
*/
EffectManager::EffectManager(RendererContext &cRendererContext) :
	m_pRendererContext(&cRendererContext),
	m_pDefault(new EffectHandler())
{
	PL_LOG(Debug, "Create effect manager")

	// Set manager name
	SetManagerName("Effect manager");

	// Unload unused resources, please
	SetUnloadUnused(true);

	// Create the standard effect
	Effect *pFX = CreateResource(Default);
	if (pFX) {
		// Create the effect
		EffectTechnique *pEffectTechnique = pFX->AddTechnique();
		if (pEffectTechnique) {
			pEffectTechnique->AddPass();
			pFX->SelectTechnique(0);
		}

		// Setup effect
		pFX->SetProtected(true);
		m_pDefault->SetResource(pFX);
		SetStandard(pFX);
	}
}
Exemplo n.º 2
0
void SetUp (void* gptr, int type)
{   int i,allocsize;
    Graph g=NULL;
    EuclidGraph xy=NULL;
    MatrixGraph matg=NULL;

    if (type==1) {
	g = (Graph) gptr;
	U = Degree(g,0);
	V = NumEdges(g);
	}
    else if (type==2) {
	xy = (EuclidGraph) gptr;
	U = xy[0][0];
	V = U*(U-1)/2;
	}
    else if (type==3) {
	matg = (MatrixGraph) gptr;
	U = matg[0];
	V = U*(U-1)/2;
	}

    allocsize = (U+2*V+2)*sizeof(int);
    A      = (int *) malloc(allocsize);
    END    = (int *) malloc(allocsize);
    WEIGHT = (int *) malloc(allocsize);
    for (i=0; i<U+2*V+2; i++)
	A[i]=END[i]=WEIGHT[i]=0;

    if (type == 1) SetStandard(g);
    else if (type == 2) SetEuclid(xy);
    else if (type == 3) SetMatrix(matg);
}