/// <summary> /// Initialize the library, starting up a "joint" context that also /// contains a server. This version of InitContext performs the default /// server operation: loading of all autoload-enabled plugins, and a hardware /// detection. /// </summary> /// <param name="applicationIdentifier">A string identifying your /// application. Reverse DNS format strongly suggested.</param> /// <returns>null, if initialization failed, else a ClientContext.</returns> public static ClientContext InitContext(string applicationIdentifier) { var clientContextHandle = JointClientKitNative.osvrJointClientInit(applicationIdentifier, IntPtr.Zero); if (clientContextHandle.IsInvalid) { return(null); } return(new ClientContext(clientContextHandle)); }
/// <summary> /// Initialize the library, starting up a "joint" context that also /// contains a server. This version of InitContext performs the default /// server operation: loading of all autoload-enabled plugins, and a hardware /// detection. /// </summary> /// <param name="options">The configuration options object for starting the joint server /// operations. Pass null for default operation: loading of all /// autoload-enabled plugins, and a hardware detection. If a non-null pointer is /// passed, the enqueued operations will be performed in-order (the default /// operations will not be performed). Any exceptions thrown will cause the /// initialization to fail, returning a null context.</param> /// <param name="applicationIdentifier">A string identifying your /// application. Reverse DNS format strongly suggested.</param> /// <returns>null, if initialization failed, else a ClientContext.</returns> public static ClientContext InitContext(ref JointClientOptions options, string applicationIdentifier) { if (options == null) { return(InitContext(applicationIdentifier)); } var clientContextHandle = JointClientKitNative.osvrJointClientInit(applicationIdentifier, options.mHandle); options = null; // options can't be re-used after Init is called. if (clientContextHandle.IsInvalid) { return(null); } return(new ClientContext(clientContextHandle)); }