| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // AppDelegate.m
- // danmaku
- //
- // Created by Sam Jaffe on 5/24/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #import "AppDelegate.h"
- @implementation AppDelegate
- @synthesize gameview;
- NSWindowStyleMask const resizable = NSWindowStyleMaskResizable;
- NSWindowStyleMask const borderless = NSWindowStyleMaskBorderless;
- - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
- {
-
- gameview = [[GameView alloc] initWithFrame:[[self window] frame]];
-
- // Insert code here to initialize your application
- [[self window] setStyleMask:[[self window] styleMask] & ~resizable];
- [[self window] setDelegate:[self gameview]];
- [[self window] makeMainWindow];
- }
- @end
- @implementation GameWindow
- - (id)initWithContentRect:(NSRect)contentRect
- styleMask:(NSWindowStyleMask)aStyle
- backing:(NSBackingStoreType)bufferingType
- defer:(BOOL)flag {
-
- // Using NSBorderlessWindowMask results in a window without a title bar.
- self = [super initWithContentRect:contentRect
- styleMask:(aStyle | borderless) & ~resizable
- backing:NSBackingStoreBuffered
- defer:NO];
- return self;
- }
- - (BOOL)canBecomeMainWindow {
- return YES;
- }
- - (BOOL)canBecomeKeyWindow {
- return YES;
- }
- @end
|