Created
May 18, 2016 17:50
-
-
Save cdun/ee66969d4a6eb2ed50832a04bc1cee6c to your computer and use it in GitHub Desktop.
Wikitude CPU / completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check that the device is supported. | |
NSError *deviceError = nil; | |
if ( [WTArchitectView isDeviceSupportedForRequiredFeatures:self.requiredFeatures error:&deviceError] ) { | |
// Create the architect view if needed. | |
if ( self.architectView == nil) { | |
WTArchitectView *architectView = [[WTArchitectView alloc] initWithFrame:self.wikitudeParentView.frame]; | |
architectView.delegate = self; | |
// Set the licence key. | |
[architectView setLicenseKey:self.wikitudeLicenceKey]; | |
[self.wikitudeParentView addSubview:architectView]; | |
self.architectView = architectView; | |
} | |
// Make sure calls are balanced. | |
if ( !self.architectView.isRunning ) { | |
// Start rendering. | |
[self.architectView start:^(WTStartupConfiguration *configuration) { | |
// Optional config for camera direction, frame rate etc. | |
configuration.captureDevicePosition = self.captureDevicePosition; | |
} completion:^(BOOL isRunning, NSError *error) { | |
if (self.loadedURL == nil) | |
{ | |
NSURL *url = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html" subdirectory:@"world"]; | |
[self.architectView loadArchitectWorldFromURL:url withRequiredFeatures:WTFeature_2DTracking]; | |
} | |
}]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment