add changelog dialog and display_file api (implemented in osx and ios)
This commit is contained in:
@@ -10,10 +10,16 @@
|
||||
#import <GLKit/GLKit.h>
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface GameViewController : GLKViewController <UIKeyInput,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
|
||||
@interface GameViewController : GLKViewController<
|
||||
UIKeyInput,
|
||||
UIImagePickerControllerDelegate,
|
||||
UINavigationControllerDelegate,
|
||||
UIDocumentInteractionControllerDelegate
|
||||
>
|
||||
{
|
||||
@public GLKView* glview;
|
||||
}
|
||||
- (void)display_file:(std::string)filename;
|
||||
- (void)reset_touch;
|
||||
- (void)async_lock;
|
||||
- (void)async_unlock;
|
||||
|
||||
@@ -62,6 +62,21 @@ NSThread* lock_thread;
|
||||
[self.context presentRenderbuffer:GL_RENDERBUFFER];
|
||||
}
|
||||
|
||||
-(void)display_file:(std::string)filename
|
||||
{
|
||||
NSString* filePath = [NSString stringWithUTF8String:filename.c_str()];
|
||||
NSURL *url = [NSURL fileURLWithPath:filePath];
|
||||
UIDocumentInteractionController *popup = [UIDocumentInteractionController interactionControllerWithURL:url];
|
||||
[popup setDelegate:self];
|
||||
[popup presentPreviewAnimated:YES];
|
||||
}
|
||||
|
||||
-(UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)pick_photo:(std::function<void(std::string)>) callback
|
||||
{
|
||||
GameImagePicker *picker = [[GameImagePicker alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user