add file picking for osx and ios and implement equirectangular import
This commit is contained in:
@@ -26,6 +26,29 @@
|
||||
{
|
||||
CGLFlushDrawable([glctx CGLContextObj]);
|
||||
}
|
||||
- (std::string)pick_file
|
||||
{
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
[panel setCanChooseFiles:YES];
|
||||
[panel setCanChooseDirectories:NO];
|
||||
[panel setAllowsMultipleSelection:NO]; // yes if more than one dir is allowed
|
||||
|
||||
NSArray* fileTypes = [NSArray arrayWithObjects:@"png", @"PNG", @"jpg", @"JPG", @"jpeg", nil];
|
||||
[panel setAllowedFileTypes:fileTypes];
|
||||
|
||||
NSInteger clicked = [panel runModal];
|
||||
|
||||
std::string ret;
|
||||
if (clicked == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
for (NSURL *url in [panel URLs])
|
||||
{
|
||||
LOG("selected file: %s", [[url path] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
ret = [[url path] cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
- (instancetype)initWithFrame:(NSRect)frameRect
|
||||
{
|
||||
gl_ready = false;
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
- (void)async_lock;
|
||||
- (void)async_unlock;
|
||||
- (void)async_swap;
|
||||
- (std::string)pick_file;
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user