WTWikitudeNativeSDK Class Reference

Inherits from NSObject
Declared in WTWikitudeNativeSDK.h

Other Methods

  renderingConfiguration

Returns the rendering configuration that was set when initWithRenderingConfiguration:delegate: was called

@property (nonatomic, strong, readonly) WTRenderingConfiguration *renderingConfiguration

Discussion

Returns the rendering configuration that was set when initWithRenderingConfiguration:delegate: was called

Declared In

WTWikitudeNativeSDK.h

  isRunning

Return the current SDK running State. YES if the SDK is running, false otherwise.

@property (nonatomic, assign, readonly) BOOL isRunning

Discussion

Return the current SDK running State. YES if the SDK is running, false otherwise.

Declared In

WTWikitudeNativeSDK.h

+ sdkVersion

Returns the Wikitude Native SDK version as a formatted string.

The format is ‘major’.‘minor’.‘bugfix’ e.g. 1.0.1

+ (NSString *)sdkVersion

Declared In

WTWikitudeNativeSDK.h

+ SDKBuildInformation

Use this method to get information about the sdk build.

+ (WTSDKBuildInformation *)SDKBuildInformation

Return Value

The current available SDKBuildInformation within the SKD.

Declared In

WTWikitudeNativeSDK.h

Accessing Device Compatibility

+ isDeviceSupportingFeatures:error:

This method should be used to determine if the current device supports all features that are required.

+ (BOOL)isDeviceSupportingFeatures:(WTFeatures)requiredFeatures error:(NSError **)error

Parameters

requiredFeatures

Bitmask that describes wich features are used from the Wikitude SDK.

error

An error object containing more information why the device is not supported if the return value is NO.

Return Value

true if the device supports all required features, false otherwise.

Discussion

This method should be used to determine if the current device supports all features that are required.

Declared In

WTWikitudeNativeSDK.h

+ resolveCaptureDeviceSettings:toSize:targetFrameRate:

Use this method to determine how the given startup configuration values are resolved on the current device.

+ (void)resolveCaptureDeviceSettings:(nullable void ( ^ ) ( WTNativeSDKStartupConfiguration *startupConfiguration ))configurationHandler toSize:(CGSize *)resolution targetFrameRate:(CMTime *)targetFrameRate

Parameters

configurationHandler

A block that can be used to define camera related options that are then resolved to it’s size and frame rate values.

resolution

On return, the size of the camera frame that can be expected at runtime

targetFrameRate

On return, the frame rate at which the camera delivers new frames. In case the SDK is running with WTRenderingMode_Internal, also rendering will run with this frame rate.

Discussion

The configuration handler can be used to define camera related options. Based on these options, camera resolution and frame rate are resolved and returned. Please note that different camera positions can have different resolutions/frame rates. Because of that it’s important to specify the captureDevicePosition in case the front cam is used.

Declared In

WTWikitudeNativeSDK.h

+ selectRenderingConfiguration:

Use this method to determine which of the Rendering Configurations passed as parameters is compatible with the current device.

+ (WTRenderingConfiguration *)selectRenderingConfiguration:(NSOrderedSet<WTRenderingConfiguration*> *)possibleConfigurations

Parameters

possibleConfigurations

An NSOrderedSet of Rendering Configurations that should be checked for compatibility.

Return Value

WTRenderingConfiguration The first compatible Rendering Configuration or nil.

Discussion

Given an ordered set of Rendering Configurations, this method will return the first one that is compatible with the current device, or nil if none of the would work. If the Rendering Configurations are created manually, this method has to be called before initializing the Wikitude Native SDK, to ensure that it is compatible with the device.

Declared In

WTWikitudeNativeSDK.h

+ createInternalOpenGLESRenderingConfiguration:

Convenience method to create a pre configured OpenGL ES Rendering Configuration with internal rendering enabled.

+ (WTOpenGLESRenderingConfiguration *)createInternalOpenGLESRenderingConfiguration:(id<WTInternalOpenGLESRenderingProtocol>)delegate

Parameters

delegate

The object that acts as a delegate for Internal rendering calls.

Return Value

WTOpenGLESRenderingConfiguration A pre configured OpenGL ES Rendering Configuration object or nil.

Discussion

This method will create two Rendering Configurations with internal rendering enabled, one for OpenGL ES 3 and one for OpenGL ES 2. It will then call selectRenderingConfiguration: and return the result.

Declared In

WTWikitudeNativeSDK.h

+ createExternalOpenGLESRenderingConfiguration:

Convenience method to create a pre configured OpenGL ES Rendering Configuration with external rendering enabled.

+ (WTOpenGLESRenderingConfiguration *)createExternalOpenGLESRenderingConfiguration:(id<WTExternalOpenGLESRenderingProtocol>)delegate

Parameters

delegate

The object that acts as a delegate for External rendering calls.

Return Value

WTOpenGLESRenderingConfiguration A pre configured OpenGL ES Rendering Configuration object or nil.

Discussion

This method will create two Rendering Configurations with external rendering enabled, one for OpenGL ES 3 and one for OpenGL ES 2. It will then call selectRenderingConfiguration: and return the result.

Declared In

WTWikitudeNativeSDK.h

+ createInternalMetalRenderingConfiguration:

Convenience method to create a pre configured Metal Rendering Configuration with internal rendering enabled.

+ (WTMetalRenderingConfiguration *)createInternalMetalRenderingConfiguration:(id<WTInternalMetalRenderingProtocol>)delegate

Parameters

delegate

The object that acts as a delegate for Internal rendering calls.

Return Value

WTMetalRenderingConfiguration A pre configured Metal Rendering Configuration object or nil.

Discussion

This method will create a Rendering Configuration with internal rendering enabled and will then call selectRenderingConfiguration: to ensure the current device is compatible with Metal, returning the result in the end.

Declared In

WTWikitudeNativeSDK.h

+ createExternalMetalRenderingConfiguration:

Convenience method to create a pre configured Metal Rendering Configuration with external rendering enabled.

+ (WTMetalRenderingConfiguration *)createExternalMetalRenderingConfiguration:(id<WTExternalMetalRenderingProtocol>)delegate

Parameters

delegate

The object that acts as a delegate for External rendering calls.

Return Value

WTMetalRenderingConfiguration A pre configured Metal Rendering Configuration object or nil.

Discussion

This method will create a Rendering Configuration with internal rendering enabled and will then call selectRenderingConfiguration: to ensure the current device is compatible with Metal, return the result in the end.

Declared In

WTWikitudeNativeSDK.h

+ createInternalRenderingConfiguration:openGLESDelegate:

Convenience method to create a pre configured Rendering Configuration with the highest rendering API available on the device, with internal rendering enabled.

+ (WTRenderingConfiguration *)createInternalRenderingConfiguration:(id<WTInternalMetalRenderingProtocol>)metalDelegate openGLESDelegate:(id<WTInternalOpenGLESRenderingProtocol>)openGLESDelegate

Parameters

metalDelegate

The object that acts as a delegate for Internal Metal rendering calls.

openGLESDelegate

The object that acts as a delegate for Internal OpenGL ES rendering calls.

Return Value

A pre configured Rendering Configuration object or nil.

Discussion

This method will create three Rendering Configurations with internal rendering enabled, one for Metal, one for OpenGL ES 3 and one for OpenGL ES 2. It will then call selectRenderingConfiguration: and return the result.

Declared In

WTWikitudeNativeSDK.h

+ createExternalRenderingConfiguration:openGLESDelegate:

Convenience method to create a pre configured Rendering Configuration with the highest rendering API available on the device, with external rendering enabled.

+ (WTRenderingConfiguration *)createExternalRenderingConfiguration:(id<WTExternalMetalRenderingProtocol>)metalDelegate openGLESDelegate:(id<WTExternalOpenGLESRenderingProtocol>)openGLESDelegate

Parameters

metalDelegate

The object that acts as a delegate for External Metal rendering calls.

openGLESDelegate

The object that acts as a delegate for External OpenGL ES rendering calls.

Return Value

A pre configured Rendering Configuration object or nil.

Discussion

This method will create three Rendering Configurations with external rendering enabled, one for Metal, one for OpenGL ES 3 and one for OpenGL ES 2. It will then call selectRenderingConfiguration: and return the result.

Declared In

WTWikitudeNativeSDK.h

– initWithRenderingConfiguration:delegate:

The designated initializer to create an object of this class.

- (instancetype)initWithRenderingConfiguration:(WTRenderingConfiguration *)renderingConfiguration delegate:(id<WTWikitudeNativeSDKDelegate>)delegate

Parameters

renderingConfiguration

The rendering configuration that should be used by the Wikitude Native SDK. If the rendering configuration was created manually, a call to selectRenderingConfiguration: must be made before passing it. Please WTRenderingConfiguration and WTRenderingMode for more information.

delegate

The object that acts as a delegate for the Wikitude native SDK object.

Return Value

WTWikitudeNativeSDK An object of type WTWikitudeNativeSDK.

Declared In

WTWikitudeNativeSDK.h

– trackerManager

Provides access to a WTTrackerManager object that coordinates tracker creation

Please refer to the WTTrackerManager documentation for more information about how to create different tracker types.

- (WTTrackerManager *)trackerManager

Return Value

A object of type WTTrackerManager that provides factory methods to create different tracker types.

Declared In

WTWikitudeNativeSDK.h

– captureDeviceManager

Provides access to a WTCaptureDeviceManager if and only if the Wikitude Native SDK is currently running.

- (nullable WTCaptureDeviceManager *)captureDeviceManager

Return Value

A valid pointer to a WTCaptureDeviceManger object if the Wikitude Native SDK is running, nil otherwise.

Discussion

WTCaptureDeviceManager objects can be used to change camera specific settings during Wikitude Native SDK runtime. To start the Wikitude Native SDK with non default camera parameter, please use the WTStartupConfiguration object that is passed to the startupHandler object when calling start:completion:

Declared In

WTWikitudeNativeSDK.h

– setLicenseKey:

Enables SDK features based on the given license key.

- (void)setLicenseKey:(NSString *)licenseKey

Parameters

licenseKey

Your developer key, provided with your licence information.

Discussion

Depending on the license key, different types of watermarks are drawn, depending on the usage of licensed features or not. When this method is not called at all, only the camera stream is rendered but nothing else will be enabled. To try out all Wikitude Native SDK features, download a trial license from our webpage and call this method with the downloaded key.

Declared In

WTWikitudeNativeSDK.h

– start:completion:

Starts Wikitude Native SDK rendering and internal updates.

This method has to be called whenever the hosting view controllers view becomes visible or the application becomes active.

- (void)start:(nullable void ( ^ ) ( WTNativeSDKStartupConfiguration *configuration ))startupHandler completion:(void ( ^ ) ( BOOL isRunning , NSError *error ))completionHandler

Parameters

startupHandler

A block object that can be used to alter the Wikitude Native SDK startup behaviour

completionHandler

A block object that can be used to evaluate if the Wikitude Native SDK could be started or not with the given startup configuration.

Discussion

Since some Wikitude Native SDK internal components start asynchronously, isRunning might be set to YES but an internal error is reported once a component encounters an error.

Declared In

WTWikitudeNativeSDK.h

– stop

Stops Wikitude Native SDK rendering and internal updates.

This method has to be called whenever the hosting view controllers view becomes not visible anymore or the application resigns active state.

- (void)stop

Discussion

When the hosting application resigns active state and the Wikitude Native SDK is still running, the behaviour is undefined.

Declared In

WTWikitudeNativeSDK.h

– shouldTransitionToSize:withTransitionCoordinator:

Call this method when the hosting view controller changes it’s size.

- (void)shouldTransitionToSize:(CGSize)size withTransitionCoordinator:(nullable id<UIViewControllerTransitionCoordinator>)transitionCoordinator

Parameters

size

The new size of the Wikitude Native SDK rendering view.

transitionCoordinator

The transition coordinator that coordinates transitioning to the new size

Discussion

This method has to be called every time the rendering view, which is used by the Wikitude Native SDK, changes it’s size. It might also be necessary to call this method after the Wikitude Native SDK was created and the final view layout was not set yet.

Declared In

WTWikitudeNativeSDK.h

– clearCache

Clears all internal caches used by the SDK.

- (void)clearCache

Declared In

WTWikitudeNativeSDK.h

Plugins Methods

– registerPlugin:error:

Call this method to register a new plugin.

- (BOOL)registerPlugin:(std : : shared_ptr<wikitude::sdk::Plugin>)plugin error:(NSError *__autoreleasing *)error

Parameters

plugin

The plugin that should be registered

error

An error object that will be filled when plugin registration fails

Return Value

BOOL YES if the plugin could be registered successfully, NO otherwise

Discussion

If a plugin with the same identifier is already registered, NO is returned, YES otherwise.

Declared In

WTWikitudeNativeSDK+Plugins.h

– removePlugin:

Call this method to remove an already registered plugin.

- (BOOL)removePlugin:(std : : shared_ptr<wikitude::sdk::Plugin>)plugin

Parameters

plugin

The plugin that should be removed.

Return Value

BOOL YES if the plugin was known and could be removed, NO otherwise.

Discussion

If the given plugin ptr is not registered, NO is returned, YES otherwise.

Declared In

WTWikitudeNativeSDK+Plugins.h

– removeNamedPlugin:

Call this method to remove an already registered plugin.

- (BOOL)removeNamedPlugin:(NSString *)pluginIdentifier

Parameters

pluginIdentifier

The Identifier that uniquely identifies the plugin that should be removed.

Return Value

BOOL YES if the plugin was known and could be removed, NO otherwise.

Discussion

Same as -removePlugin but searches for the plugin to remove by the given identifier. Using this method, no shared_ptr property needs to be added to any object because the Wikitude Native SDK takes ownership of any plugin.

Declared In

WTWikitudeNativeSDK+Plugins.h