![]() |
![]() ![]() |
create an instance from a given template name
OMobj_id parent_id ,
char * class_name ,
char * instance_name );
GDcreate_instance creates an instance given a template name.
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.
The name of the new object's class object, such as DefaultView.
The object id of the new object; NULL if GDcreate_instance failed.
/* 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");
![]() |
![]() ![]() |