ebiten/ui/cocoa/run.c
2013-10-14 02:04:26 +09:00

23 lines
765 B
C

// -*- objc -*-
#include <stdlib.h>
#import "ebiten_controller.h"
#import "ebiten_window.h"
void Run(size_t width, size_t height, size_t scale, const char* title) {
@autoreleasepool {
EbitenWindow* window = [[EbitenWindow alloc]
initWithSize:NSMakeSize(width * scale, height * scale)];
[window setTitle: [[NSString alloc] initWithUTF8String:title]];
EbitenController* controller = [[EbitenController alloc]
initWithWindow:window];
NSApplication* app = [NSApplication sharedApplication];
[app setActivationPolicy:NSApplicationActivationPolicyRegular];
[app setDelegate:controller];
[app finishLaunching];
[app activateIgnoringOtherApps:YES];
[app run];
}
}