Add GLFW reference

This commit is contained in:
Chinmay Garde
2021-05-04 11:51:52 -07:00
committed by Dan Field
parent 2092759b01
commit e8a4173daf
2 changed files with 11 additions and 7 deletions

View File

@@ -38,5 +38,6 @@ executable("host") {
":impeller_host_shaders", ":impeller_host_shaders",
"//flutter/fml", "//flutter/fml",
"//flutter/impeller/impeller", "//flutter/impeller/impeller",
"//third_party/glfw",
] ]
} }

View File

@@ -6,7 +6,8 @@
#include "impeller_host_view_controller.h" #include "impeller_host_view_controller.h"
@interface ImpellerAppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate> { @interface ImpellerAppDelegate
: NSObject <NSApplicationDelegate, NSWindowDelegate> {
NSWindow* window_; NSWindow* window_;
ImpellerHostViewController* view_controller_; ImpellerHostViewController* view_controller_;
} }
@@ -17,11 +18,11 @@
- (id)init { - (id)init {
if (self = [super init]) { if (self = [super init]) {
view_controller_ = [[ImpellerHostViewController alloc] init]; view_controller_ = [[ImpellerHostViewController alloc] init];
window_ = window_ = [[NSWindow alloc]
[[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) initWithContentRect:NSMakeRect(0, 0, 800, 600)
styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable
backing:NSBackingStoreBuffered backing:NSBackingStoreBuffered
defer:NO]; defer:NO];
[window_ setContentViewController:view_controller_]; [window_ setContentViewController:view_controller_];
} }
return self; return self;
@@ -48,7 +49,9 @@ int main(int argc, const char* argv[]) {
[item.submenu [item.submenu
addItem:[[NSMenuItem alloc] addItem:[[NSMenuItem alloc]
initWithTitle:[@"Quit " initWithTitle:[@"Quit "
stringByAppendingString:[NSProcessInfo processInfo].processName] stringByAppendingString:[NSProcessInfo
processInfo]
.processName]
action:@selector(terminate:) action:@selector(terminate:)
keyEquivalent:@"q"]]; keyEquivalent:@"q"]];
ImpellerAppDelegate* appDelegate = [[ImpellerAppDelegate alloc] init]; ImpellerAppDelegate* appDelegate = [[ImpellerAppDelegate alloc] init];