Rik's Treehouse > Babbling in Binary > My Software > Orphanware > R2DToo > R2DToo Help > For the Programmer > onModelLoad

onModelLoad

Declaration
Remarks
Revisions
Example
See Also

Declaration

void __stdcall onModelLoad(void);
Top of page

Remarks

This optional function may be provided by the model. It is called just after the model is loaded. Use it to add model parameters with the functions
setParamCount and assignParam. Since this function is only called once it is also a good place to allocate temporary workspace or seed a random number generator, such as randomize, if required. Top of page

Revisions

API v1.5
  • new!
Top of page

Example

float *workspace = NULL; void __stdcall onModelLoad(void) { setParamCount(4); // index name [constraints] default value assignParam(0, "World Width [int,>0]", 30); assignParam(1, "World Height [int,>0]", 30); assignParam(2, "Initial Density [>0,<1]", 0.5); assignParam(3, "Fade Rate [int, >0,<=255]",255); workspace = new float[100]; randomize(); } void __stdcall onModelUnload(void) { delete [] workspace; }
Top of page

See Also

onModelUnload, setParamCount, assignParam.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:42pm