implement sharing in iOS, add OpenGL renderer in OSX window

This commit is contained in:
2018-11-30 20:41:52 +01:00
parent 9f41831b71
commit 3a88235f56
5 changed files with 24 additions and 16 deletions

View File

@@ -70,6 +70,21 @@ std::recursive_mutex lock_mutex;
[self.context presentRenderbuffer:GL_RENDERBUFFER];
}
- (void)share_file:(NSString *)file_path
{
NSURL *url = [NSURL fileURLWithPath:file_path];
NSArray *objectsToShare = @[url];
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
controller.excludedActivityTypes = @[];
controller.popoverPresentationController.sourceView = self.view;
controller.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width/2, self.view.bounds.size.height/4, 0, 0);
// Present the controller
[self presentViewController:controller animated:YES completion:nil];
}
-(void)display_file:(std::string)filename
{
NSString* filePath = [NSString stringWithUTF8String:filename.c_str()];