![]() |
![]() |
![]() |
![]() |
GDcreate_instance
Synopsis
create an instance from a given template name
OMobj_id _ GDcreate_instance (
OMobj_id _ parent_id ,
char _* class_name ,
char _* instance_name _);Description
GDcreate_instance creates an instance given a template name.
Parameters
The id of the new instance's parent object. The new object becomes an immediate subobject parent_id .
You can specify NULL. The new object becomes an immediate subobject of Applications, Default Applications, ModuleStack, or ScratchPad.
Returned Value
The object id of the new object; NULL if GDcreate_instance failed.
Example
/* Create a camera called mycamera. Its parent is app1_id.
__Its template is DefaultCamera. */
OMobj_id _app1_id; /* Assume this has been set. */
OMobj_id _mycamera_id;
...
mycamera_id = GDcreate_instance(app1_id, "DefaultCamera",
"mycamera");
if (OMis_null_elem(mycamera_id))
printf("Error creating camera\n");
![]() |
![]() |
![]() |
![]() |