Vp create: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
Oliver (talk | contribs)
Fixed return values.
Sleepy E (talk | contribs)
mNo edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<C>VPInstance vp_create(void)</C>
{{sdk method page|create|Creates a new SDK instance in memory for connecting to a universe and world.
|parameters=
  {{sdk parameter row|vp_net_config*|net_config|Network configuration for the instance or NULL to use the default select-based implementation. The contents of the structure will be copied.}}
|customparamex=net_config
|noinstanceparam=
|returns=A pointer to the newly created instance, or {{code|NULL}} if something went wrong whilst trying to create one.
|examples=
<syntaxhighlight lang="c">
VPInstance instance;


== Description ==
instance = vp_create(NULL);
Creates a new VP SDK instance.
if (!instance)
 
  printf("Unable to create instance\n");
== Callback ==
</syntaxhighlight>
None
|seealso=
 
* {{sdk method|connect_universe}}
== Notes ==
* {{sdk method|destroy}}
None
* {{sdk method|login}}
 
}}
== Arguments ==
None
 
== Argument attributes ==
None
 
== Return values ==
;[[VPInstance]]:The newly created instance.
;NULL:There was an error creating the instance.
 
== Returned attributes ==
None
 
== Example ==
<C>VPInstance instance;
instance = vp_create();</C>
 
== See also ==
* [[vp_connect_universe]]
* [[vp_destroy]]
* [[vp_login]]

Latest revision as of 19:18, 1 August 2018

Method call snippet vp_create(net_config);

Creates a new SDK instance in memory for connecting to a universe and world.

Parameters

These are the parameters that this method requires:

Parameter Usage
vp_net_config*
net_config
Network configuration for the instance or NULL to use the default select-based implementation. The contents of the structure will be copied.

Returns

A pointer to the newly created instance, or NULL if something went wrong whilst trying to create one.

Behavior

There is no special behavior for this method

Examples

VPInstance instance;

instance = vp_create(NULL);
if (!instance)
  printf("Unable to create instance\n");

See also