mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-22 02:09:06 +00:00
first step to get cocoa events
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1857 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
d9511addf3
commit
a255ea66cf
7 changed files with 114 additions and 56 deletions
|
@ -1,52 +1,5 @@
|
|||
#import "cocoaGL.h"
|
||||
|
||||
@implementation NSApplication(i)
|
||||
- (void)appRunning
|
||||
{
|
||||
_running = 1;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface cocoaAppDelegate : NSObject
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
||||
@end
|
||||
|
||||
@implementation cocoaAppDelegate : NSObject
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
void cocoaGLCreateApp()
|
||||
{
|
||||
ProcessSerialNumber psn;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
if (!GetCurrentProcess(&psn)) {
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
SetFrontProcess(&psn);
|
||||
}
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (NSApp == nil) {
|
||||
[NSApplication sharedApplication];
|
||||
//TODO : Create menu
|
||||
[NSApp finishLaunching];
|
||||
}
|
||||
|
||||
if ([NSApp delegate] == nil) {
|
||||
[NSApp setDelegate:[[cocoaAppDelegate alloc] init]];
|
||||
}
|
||||
|
||||
[NSApp appRunning];
|
||||
|
||||
[pool release];
|
||||
|
||||
}
|
||||
|
||||
NSWindow *cocoaGLCreateWindow(int w,int h)
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue