R3ClassCreate

FUNCTION:

R3ClassCreate

TEMPLATE:

R3CLASS *R3ClassCreateA(R3UWORD super, R3UWORD id, R3OBJPROC op, int size, R3TAG *tags)

PARAMETERS:

super - class id of the super class (base class)

RETURN VALUE:

Class pointer

DESCRIPTION:

Registers new object class. The dispatcher function 'R3OBJPROC' must be of form:

 R3SetAttrs(sphere,
 R3SPHA_Radius, &radius,
 R3TAG_END);

The class dispatcher function of the sphere class receives the following

PARAMETERS:

cl = pointer to sphere's class structure

EXAMPLE:
 typedef struct myinstancedata {
 int foo;
 }MYIDATA;

 void mydispatcher(R3CLASS *cl, R3OBJ *obj, int mth, void *p1, void *p2, void *msg)
 {
 switch(mth)
 {
 case MYM_FOO:
 ...
 break;

 case ...:

 default:
 return R3InheritA(cl, obj, mth, p1, p2, msg);
 }
 }

 int RegisterMyClass(R3APP *app)
 {
 if(R3RegisterClass(R3CLID_ROOT, R3CLID_MYID, mydispatcher, sizeof(MYIDATA), R3TAG_END))
 return TRUE;
 return FALSE;
 }