mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 05:38:50 +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
|
@ -6,18 +6,27 @@ import sys
|
|||
name = "Plugin_PadSimple"
|
||||
|
||||
if not env['HAVE_X11']:
|
||||
print name + " must have X11 to be built"
|
||||
Return()
|
||||
if not env['HAVE_COCOA']:
|
||||
print name + " must have X11 to be built"
|
||||
Return()
|
||||
|
||||
if env['GLTEST']:
|
||||
print name + " Doesn't work with testgl"
|
||||
Return()
|
||||
|
||||
|
||||
files = [
|
||||
"PadSimple.cpp",
|
||||
]
|
||||
padenv = env.Clone()
|
||||
|
||||
|
||||
if padenv['HAVE_COCOA']:
|
||||
compileFlags = [
|
||||
'-x',
|
||||
'objective-c++',
|
||||
]
|
||||
|
||||
if padenv['HAVE_WX']:
|
||||
files += [
|
||||
"GUI/ConfigDlg.cpp",
|
||||
|
|
|
@ -230,7 +230,6 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
//setup ogl to use double buffering
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
#elif defined(HAVE_COCOA) && HAVE_COCOA
|
||||
cocoaGLCreateApp();
|
||||
GLWin.width = nBackbufferWidth;
|
||||
GLWin.height = nBackbufferHeight;
|
||||
GLWin.cocoaWin = cocoaGLCreateWindow(GLWin.width, GLWin.height);
|
||||
|
|
|
@ -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