DemoGL::Reference::Functions::DEMOGL_EffectRegister

DEMOGL_EffectRegister

DEMOGL_EffectRegister registers an instance of a CEffect derived class. A CEffect derived class is the place where you put your effectcode. When the instance is registered with DemoGL, you can execute that instance using _SYSTEM script commands.

void
DEMOGL_EffectRegister(
	CEffect * const pEffectObject,
	const char *pszEffectName
);
	
Parameters.
pEffectObject
Pointer to an instance of a CEffect derived effect class. This pointer should be constant, so you can't move your instances in memory after you've registered them.
pszEffectName
Pointer to a zero-terminated string which represents the name of the instance pointed by pEffectObject. This name will be the indentifier to identify in the script which effect object should be used. This name should be unique.

Return values.

Remarks.
You should register your effectobjects before you call DEMOGL_AppRun, using DEMOGL_EffectRegister. Keep the name pointed by pszEffectName unique in your application. This name is case sensitive, though it's recommended to distinquish effect instances by name, not case. Allthough your effect classes are not of type CEffect, you can reference them by using the base class which is of type CEffect. Therefor the pointer pEffectObject is of type CEffect, so all kinds of effect classes can be passed.

Example.
// CMyEffectClass is a derived class from CEffect
CMyEffectClass	*pMyEffect;

// create instance
pMyEffect = new CMyEffectClass;

// register this instance with DemoGL, under the name "MyEffect"
DEMOGL_EffectRegister(pMyEffect, "MyEffect");

// start application
DEMOGL_AppRun(hInstance, &sdStartupDatValues, "My title", false,0,0,RUNTYPE_NORMAL);

// Application ends
DEMOGL_AppEnd();

// Clean up my effectclass
delete pMyEffect;
	

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_AppRun, CEffect, _SYSTEM script commands

Last changed on 20-jan-2001

©1999-2001 Solutions Design