|
@@ -12,12 +12,28 @@
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
#import "cocoaPandaAppDelegate.h"
|
|
#import "cocoaPandaAppDelegate.h"
|
|
|
|
|
+#include "graphicsEngine.h"
|
|
|
|
|
|
|
|
@implementation CocoaPandaAppDelegate
|
|
@implementation CocoaPandaAppDelegate
|
|
|
|
|
|
|
|
|
|
+- (id) initWithEngine:(GraphicsEngine *)engine {
|
|
|
|
|
+
|
|
|
|
|
+ if (self = [super init]) {
|
|
|
|
|
+ _engine = engine;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return self;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
|
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
|
|
// This only seems to work when called here.
|
|
// This only seems to work when called here.
|
|
|
[NSApp activateIgnoringOtherApps:YES];
|
|
[NSApp activateIgnoringOtherApps:YES];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)applicationWillTerminate:(NSNotification *)notification {
|
|
|
|
|
+ // The application is about to be closed, tell the graphics engine to close
|
|
|
|
|
+ // all the windows.
|
|
|
|
|
+ _engine->remove_all_windows();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|